Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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



what is diff b/n these 2 programs 1) for i=5 to 1 step 2 msgbox "pass" next 2_) for i..

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

what is diff b/n these 2 programs 1) for i=5 to 1 step 2 msgbox "pass" next 2_) for i..

Answer / mano

the above answer is right but in second program pass wil display 3 times

Is This Answer Correct ?    6 Yes 0 No

what is diff b/n these 2 programs 1) for i=5 to 1 step 2 msgbox "pass" next 2_) for i..

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

what is diff b/n these 2 programs 1) for i=5 to 1 step 2 msgbox "pass" next 2_) for i..

Answer / ankit

OH ya...i agree
it will show message 3 times

Is This Answer Correct ?    4 Yes 0 No

what is diff b/n these 2 programs 1) for i=5 to 1 step 2 msgbox "pass" next 2_) for i..

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

Post New Answer

More VB Script Interview Questions

How to use QTP Object in .vbs(vbscript file) file Ex: Browser().., wait(), exist() and etc...

0 Answers  


what is the function to display current date?

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  


My Salary is 65000. How Much TDS I have to pay

0 Answers  


Suppose by navigation I went from 1 st page to 5 page ,so Write a generic script for coming from any page to the 1st page and by executing where the page may be it will come to 1st page

1 Answers   CybAge,


Consider there are objects in a webapp which are identified by QTP. Suppose you know only the logical name of a object(absolutely nothing else about it). Which approach will you take to find the "micClass" of the object(You can't use Object Spy, or can't add the object in repository)?

2 Answers   HCL,


How to make professional test report using vbscript code in UFT, which gives us complete analysis of the test.

0 Answers   College School Exams Tests,


Can someone please tell me what poor design in a relational database (not the layout or style) is and how it can be avoided? PLEASE...im desperate.

0 Answers  


How will you release the memory acquired by an array variable in vbscript?

0 Answers  


Which date function is used in the vbscript language to find the difference between the 2 dates?

0 Answers  


How do you write an SQL insert statement?

4 Answers   HCL,


PLz send me the VB scripts which is having more examples my email id : hareen_11@yahoo.com

0 Answers  


Categories