. Program for sorting of numbers in vb script?
Answers were Sorted based on User's Feedback
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 |
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 |
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
What are the valid scopes of a variable in vbscript?
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
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 ?
why do u choose to go for testing why cant for devoloping
how to declare a variable in vbscript using vbscript
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.
input values to accept 2 numbers & print the product, difference and sum using switch case
Explain the extension .hta?
How to delete a cookie using vbscript?
Mention what if you do not specify anything when you call a procedure?
Can any 1 modify the code whr in want to add\rename a excel sheet in qtp?