View Single Post
  #20   Spotlight this post!  
Unread 16-02-2002, 22:14
GhettoTech GhettoTech is offline
Registered User
#0300 (Ghetto Techs)
 
Join Date: Feb 2002
Location: Philadelphia
Posts: 21
GhettoTech is an unknown quantity at this point
Send a message via AIM to GhettoTech
From my understanding of the original posted question, you want to avoid typing multiple "IF" statements.

http://parallaxinc.com/downloads/Doc...ual%20v2.0.pdf

That's a link to the manual for the Basic Stamp, look up the "Branch" code. (Pages 85 & 86)

~Excerpt from Basic Stamp Manual~
[b]Explanation:[\B]
The BRANCH instruction is useful when you want to write something like this:
IF value = 0 THEN case_0 ' value =0: go to label "case_0"
IF value = 1 THEN case_1 ' value =1: go to label "case_1"
IF value = 2 THEN case_2 ' value =2: go to label "case_2"

You can use BRANCH to organize this into a single statement:
BRANCH value, [case_0, case_1, case_2]