CASE usage
El Paisa
Posts: 375
I quite understand the manual entry about CASE.
I wonder if somebody give me a couple of examples of the use of CASE.
I really appeciate.
I wonder if somebody give me a couple of examples of the use of CASE.
I really appeciate.
Comments
This is from the object that produces pulses that I posted:
http://forums.parallax.com/forums/default.aspx?f=25&m=139628
it gets the code for the key pressed using the getkey method and compares it to $C0 to $C3 in turn. If for example the key was the right arrow, kb.getkey would be $C1 and the code "on_time := on_time + 10 " would be run.
Once one of the cases is found to be true no others are checked and it jumps to the next part of the program.
Graham