Loops

A body of code can be executed a number of times using a ‘while’ loop. The ‘while’ loop evaluates a condition, and while the condition is ‘true’, it executes the enclosed block of code

For example:

$count = 0;
while( $count < 10 ) {
   log.info( "In loop, count = " . $count );
   $count = $count + 1;
}

The 'break' and 'continue' statements can be used within a loop to either stop the loop processing immediately, or to restart the loop processing again.

In ZXTM, TrafficScript contains a number of helper functions to manipulate complex data, such as HTTP requests or long strings. Consequently, it is rarely necessary to use loops in TrafficScript.

Owen Garrett [Zeus Dev Team] 01 July 2005  Permalink  
Leave a comment ...
Your email address will not be displayed.
Your URL will be displayed.
This public messageboard is not a forum for technical support. To report technical support problems, please contact our dedicated Support team using the instructions at the bottom of this page.
Options:
 
(Line breaks become <br />)
(Set cookies for name, email & url)
Download Free ZXTM Desktop Edition

Recent Articles

Other Resources



www.zeus.com