. 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 want to count the total no of links present in yahoo home page. The script like Set fileSysObject=createobject("Scripting.FileSystemObject") Set linksFileName=fileSysObject.opentextfile("D:\samplelinkfile.txt",2,true) Set linkDescObj=description.Create linkDescObj("micclass").value="Link" Set noOfLinks=browser("yahoo").Page("Yahoo!India").ChildObjects(linkDescObj) For i=0 to noOfLinks.count-1 linkName=noOfLinks(i).getROProperty("name") linksFileName.writeline(linkName) Next linksFileName.close Set fileSysObject=nothing But while running the script it is fail (the object not present in the object repository).How to overcome please tell me the detail steps...for QTP9.30

1 Answers  


What are the valid scopes of a variable in vbscript?

0 Answers  


Have any one know about Test Complete 6, please let me know. If any one have good material regarding Test Complete 6, Please send to my mail id: cns.praveen@gmail.com

1 Answers  


How do I check that the names in a weblist are correct e.g in flight application the names of item are Denver, paris,London, etc. How do I ensure the correct item is displayed from the list after doing item count ?

2 Answers   IBM,


why do u choose to go for testing why cant for devoloping

0 Answers  






how to declare a variable in vbscript using vbscript

4 Answers  


Hai this is sheik, i want to learn VB scripts for web application pls guide me what are all basic things need to know to learn VB scripts in web application.

0 Answers  


input values to accept 2 numbers & print the product, difference and sum using switch case

1 Answers   CSC,


Explain the extension .hta?

0 Answers  


How to delete a cookie using vbscript?

0 Answers  


Mention what if you do not specify anything when you call a procedure?

0 Answers  


Can any 1 modify the code whr in want to add\rename a excel sheet in qtp?

1 Answers  


Categories