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
How to use QTP Object in .vbs(vbscript file) file Ex: Browser().., wait(), exist() and etc...
create a form to accept username and password validate the username and password with using message box, display the corresponding user message
Explain about the extension .hta?
Which in-built functions are used to convert the specified expression in the form of date and string in the vbscript language?
Develop a parameterized action that accomplishes the following a. Launch a browser of users choice ( example : IE, chrome etc) b. Open up a search engine (Google, Bing etc) c. Perform a search d. Click a particular link depending on the user’s choice ( 1st , 2nd or third link)
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
1. How do declare public variable in vb scripts?
How are values assigned to the variables in the vbscript language?
What is the use of the date function in the vbscript language?
What are the advantages of vbscript?
Explain about scrrun.dll?
How to assign a numeric value to a variable?
In html file what is an ideal position to include vbscript?
How can the spaces from the string be removed?
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