. 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

i wrote vbscripit code in notepad i got error i am in learning stage if u ps tell me what wrong in my code my error is "object required descriptive at line one run time error"and my code is "set usernameobj=Descriptive.Create() usernameobj( "name").value="Username" set passwordobj=Descriptive.Create() passwordobj("name").value="password" set signinobj=Descriptive.Create() signinobj("name").value="sigin" browser("gmail").page("gmail").WebEdit("usernameobj").set ("enter username") Browser("gmail").Page("gmail").WebEdit("passwordobj").Set secure.Crypt.Encrypt("enter password") browser("gmail").page("gmail").WebButton("siginobj").click

0 Answers  


regular expression that will recognize a browser as long as its name property starts with mybrowser

0 Answers   Banking,


how to acces the remote mechine using vb cript(QTP)

0 Answers   TCS,


Create a file system object to do the following i. Create a folder ii. Create a text file in the folder iii. Update text file with some tex

2 Answers  


How can I access an object in another frame?

1 Answers  






Which loop is used in case of arrays in the vbscript language?

0 Answers  


Like OPTION EXPLICIT statement what are the other statements used in vbscript and their usage. Please post me all the statements please.

0 Answers   Accenture,


If anyone knows abt Test Complete material, Pls let me Know. if u have any material or any documents..... Pls mail me on this mail Id...... This is very Urgent Requirment..... for my Project.....

3 Answers  


What are the disadvantages of vbscript?

0 Answers  


how to find number of characters(letter a) in the sentence Rain Rain Go away

4 Answers  


What is vbscript procedures?

0 Answers  


Explain the functionality of vbscript?

0 Answers  


Categories