. Program for sorting of numbers in vb script?

Answer Posted / amrita

We will assign the series of numbers in array then will the sort that. Below is the code:
a = array(3,4,9,2,7,1)

For i=0 to ubound(a)

For j=0 to ubound(a)
If strComp(a(i),a(j),1) < 0 Then
temp = a(i)
a(i) = a(j)
a(j) = temp
End If
Next

Next

For i=0 to ubound(a)

print a(i)
'It will print 1,2,3,4,7,9

Next

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Mention what is vbscript?

593


What methods are used to create text files and open text files in the vbscript language?

534


Why to use option explicit in vb script?

594


How you can call vbscript functions?

577


How are values assigned to the variables in the vbscript language?

569






Please let me Know regarding any material regarding VB Scripting which should be easily understandable for Beginners.

1537


How to pass argument by reference to a function in vbscript?

536


Mention when to use function procedures and what are its characteristics?

625


Which object is used to work with the excel sheets in the vbscript language and what statement is used to create this object?

481


Differentiate javascript and vbscript?

567


I am working on QTP, got struck in one place.. In my application depending upon configuration WebEdit count is increasing/ decreasing.. how to get these webedits..

1801


Capture the Unique label changes on google home page for I am feeling lucky button and save those label changes to Notepad Note: Using QTP

1871


Explain the constants in vbscript?

561


How will you compare two strings in vbscript?

592


How to add actions in driver script to run those actions in QTP?

1516