RunningShoes Library for WinRunner
Custom WinRunner Functions
A Random Collection of WinRunner Solutions
Creating DLLs for WinRunner
Infinite loop: for() vs. while()
To drive an infinite loop, skip the condition, so WinRunner is not forced to evaluate it. An infinite loop will have another condition inside the loop to break the loop; why evaluate two conditions when only one matters? While speed is often not a concern in running a test script, it's still a good idea to develop the habit of writing efficient code.
The standard in C/C++ is a for loop with no condition:
for( ; ; )
WinRunner users often recommend using a condition that will always return TRUE to drive an infinite loop. One of the most common examples is this, with a while loop:
This certainly works. However, each time the while() executes, the condition must be evaluated. The for() executes more efficiently, because it has no condition to be evaluated.
Copyright R. E. Cook Consulting, 2000 - 2011.
The site is designed to look best when viewed with Internet Explorer 5.0 - 8.0. Results with other browsers will probably deviate from what is intended.
NOTE: This website refers to registered trademarks and service marks that are owned by other companies, including Mercury Interactive, WinRunner, TestDirector, TSL, Microsoft, Windows.