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
Answer Posted / 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 |
Post New Answer View All Answers
Which operator can be used to change the value of the operand or change the state of the condition?
what is resorceallocation
How will you release the memory acquired by an array variable in vbscript?
Which in-built functions are used to convert the specified expression in the form of date and string in the vbscript language?
What are the valid scopes of a variable in vbscript?
Which operator can be used to check if two numbers are equal or not in vbscript?
can anyone tell me the procedure of interview held in applabs
Capture the Unique label changes on google home page for I am feeling lucky button and save those label changes to Notepad Note: Using QTP
Explain the arrays in vb script?
How to Import data from a file (file is on the desktop) to the data table
What are the special sub-types in vbscript?
Out of the different type of operators, which are evaluated first and last in the vbscript language?
In the Web page we have a table link, if we click on that link all the contents under that link will be sorted (asscending/Descending). Now i want to check in which order the list is ? for that i need to get the data in to some var How can i get that cells data?
Explain about adodb.stream class?
I want to run QTP script on Linux server is it possible to do this by connecting Windows to Linux through VPN/Terminal Server and just run the script on Linux server.