Does SX/B support IF x THEN y ?
lcarr
Posts: 2
I now·SX/B supports:
if x THEN GOTO_LABEL
but
Does SX/B support the sentence:
if x THEN y ' where y is a sentence, for example: IF x > 5 THEN y = 1
Besides this, does it support bitwise operators in conditionals?
For example, using:
if x & 1·<> 0·THEN GOTO_LABEL ' gives an error
while the following works:
z = x & 1
if· z<>0 THEN GOTO_LABEL
Obviously what I wanted to do is something like the following:
IF x & 1 <> 0 THEN y = 1
·
if x THEN GOTO_LABEL
but
Does SX/B support the sentence:
if x THEN y ' where y is a sentence, for example: IF x > 5 THEN y = 1
Besides this, does it support bitwise operators in conditionals?
For example, using:
if x & 1·<> 0·THEN GOTO_LABEL ' gives an error
while the following works:
z = x & 1
if· z<>0 THEN GOTO_LABEL
Obviously what I wanted to do is something like the following:
IF x & 1 <> 0 THEN y = 1
·
Comments
IF x > 5 THEN
· y=1
ENDIF
You can also use ELSE
IF x > 5 THEN
· y = 1
ELSE
· y=2
ENDIF
"IF x & 1 <> 0 THEN y = 1" can be done by testing bit 0 of x
IF x.0 <> 0 THEN
· y = 1
ENDIF
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"SX-Video·Module" Now available from Parallax for only $28.95
http://www.parallax.com/detail.asp?product_id=30012
"SX-Video OSD module" Now available from Parallax for only·$49.95
http://www.parallax.com/detail.asp?product_id=30015
Product web site: www.sxvm.com
Those that would give up freedom for security will have neither.
Post Edited (Bean (Hitt Consulting)) : 12/7/2005 7:18:06 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·1+1=10