. Program for sorting of numbers in vb script?

Answers were Sorted based on User's Feedback



. Program for sorting of numbers in vb script?..

Answer / abc

Const FOF_CREATEPROGRESSDLG = &H0&

Const MyZip ="C:Documents and SettingsabcdDesktopWIPMyZipFile.zip"

Const File1 = "C:Documents and SettingsabcdDesktopWIPABCD.xml"

'-------------- create empty zip file ---------

'Create the basis of a zip file.
CreateObject("Scripting.FileSystemObject") _
.CreateTextFile(MyZip, True) _
.Write "PK" & Chr(5) & Chr(6) & String(18, vbNullChar)


'-------------- zip ---------------------------

'get ready to add files to zip
With CreateObject("Shell.Application")

'add files
.NameSpace(MyZip).CopyHere File1, FOF_CREATEPROGRESSDLG

End With
wScript.Sleep 1000

wscript.echo "Done!"

'-------end adding files to zip folder------------------------------

Is This Answer Correct ?    0 Yes 0 No

. Program for sorting of numbers in vb script?..

Answer / 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

More VB Script Interview Questions

What is the difference between VBScript and JavaScript?

0 Answers  


Why is the use of exit do or exit for statements within loops discouraged?

0 Answers  


what is the standards used for writing the script in QTP

0 Answers  


Mention how to assign a date value to a variable?

0 Answers  


Explain the tristate constants in vbscript?

0 Answers  


Which operator can be used to check if two numbers are equal or not in vbscript?

0 Answers  


How will you get the largest subscript of an array in vbscript?

0 Answers  


Could Anybody tell me the VBscript for REVERSE an Integer int reverse(int num) Ex:246 to 642

7 Answers   Amazon,


what is the differance between BYVAL,BYREF?

0 Answers  


Which is the default Data types in VBScript?

5 Answers  


What are class variables?

0 Answers  


write a vb script to open a text file and write into it

2 Answers  


Categories