Re Iptscrae Python and While

Bluexcell bluexcell at aol.com
Wed Feb 25 18:01:58 EST 2004


While:
This repeatedly tests the expression and, if it is true, executes the first
suite; if the expression is false (which may be the first time it is tested)
the suite of the else clause, if present, is executed and the loop terminates.

The problem with using While as a scanner loop is the loop cycle is carried out
at the natural cycle rate and is fixed, also one would have to define a
function that contained  a while loop in order to control it remotely,? 

What i want is a loop in which the the cycle rate is a variable, so it can be
controlled globally from other functions,  I also need  to set a variable to
start and stop the loop  so i can call it and set it globally from other
functions and  i can see that is possible, by containing the While loop in a
function.
The purpose of the loop is to scan for events, these are the #body, and  the
result of those function calls may require a change in the scan rate or for the
scan to stop and command to pass elswhere.. ie another function. While can be
exited using break i know and it can resume using continue. but it seems an
unwieldy and ugly way to do it.
I will study it further though.. perhaps there is a clean way i havent seen
yet.
Thanks. Incony 



More information about the Python-list mailing list