Thread: Simple question
View Single Post
  #4  
Old 07-03-2002, 12:11 PM
screen_name screen_name is offline
is watching you
Join Date: Mar 2002
Location: The 3rd Dimension
Posts: 2,160
screen_name is on a distinguished road
Send a message via AIM to screen_name Send a message via MSN to screen_name
well, since there is only two possible flags, on or off, i just use variables 0 and 1

take the current status of the light, lets say off (off=0) and then just take the absolute value of the status -1, so
0-1 = -1
|-1| = 1

turns from off (0), to on (1)

same way around
1-1 = 0
|0| = 0

turns from on (1), to off (0)
__________________
[signature]insert here[/signature]
Reply With Quote