static int state = 0; void mySstateTest(void) { for(;;) { DoSomeImportantAction(); if ( 0 == state ) { if ( 1 == GetValueFromSomewhere() ) { state = 1; } } if ( 1 == state) { if ( 0 == GetValueFromSomewhere() ) { state = 1; } } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)