what is diff b/n these 2 programs
1) for i=5 to 1 step 2
msgbox "pass"
next
2_) for i=5 to 1 step -2
msgbox "pass"
next
Answers were Sorted based on User's Feedback
Answer / veer
From the first one will not display any message box because the condition is not true but it shows result as "done" in the result window .
From the second one will display a message box "pass" 3 times
| Is This Answer Correct ? | 8 Yes | 0 No |
Answer / mano
the above answer is right but in second program pass wil display 3 times
| Is This Answer Correct ? | 6 Yes | 0 No |
Answer / manisha
In the first one it will not display any result.Because the
condition given is wrong .
In the second one the result is displayed as pass for 3
times.
Condition for ForLoop:-
the limit must be in increament order (OR) if the limit is
decreament order we have to mention "Step -n",where n is
to skip or jump .
In the above example:-
For the 1st - no result
for the 2nd - The result is displayed as pass for 3 times.
because for i=5 to 1 step -2
i=5
i=3(jumped to 5-2=3)
i=1(jumped to 3-2=1)
| Is This Answer Correct ? | 5 Yes | 0 No |
Answer / ankit
the first one will not print any message because the
condition is not true
the second one will print message pass 2 times
| Is This Answer Correct ? | 1 Yes | 4 No |
Which is the default Data types in VBScript?
How to select a value from a list box by using Selenium web-driver?
How to identify column in VSFlexgrid? My VSFlexgrid window is identified as 'Active X Control'
How to search word in a string without using instring function?
what is used of Property........End Property loop ? how to write the script for it?
Mention what is vbscript procedures?
write a vb script to display the code "vbscripting" alphabet by alphabet(i e 1st v then b and up to g)
write a vb script code to display the vbscript word by word (i e 1st it should display v then b and up to t )
Why is it recommended to close the database connection every time after the work is completed?
what is the code in QTP to take screen shot? Please send me any one to my mail id. my mailid is manu.sanepalli@gmail.com
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
write a vb script to generate fibonnaci numbers