Posted by Antony Espindola on July 15, 1998 at 05:00:26:
In Reply to: A deeper explanation! posted by Antony Espindola on July 15, 1998 at 04:57:31:
Did you spot the deliberate mistake in my code?
Good! Shows you were paying attention!
The code should read like this...
if (SwitchIsOn == 0)
{
SwitchIsOn =1;
SetWallCel(MyButton, 1);
Sleep(Delay);
SetWallCel(MyButton, 1);
SwitchIsOn = 0;
}
Return;
If we don't set it back to zero, the next time round the loop
it won't be able to go back in!