Conditions Help please
Brian Carpenter
Posts: 728
currently the code reads like this.· Thanks to help from this Forum.
SELECT X
CASE X <= 6500
· GOSUB UP
CASE X >= 6900
· GOSUB DOWN
CASE ELSE
· DEBUG CR, "······ ECenter"
· pw = 750
· S_Chan = cha
· S_Speed = rb
· GOSUB SendIt
ENDSELECT
But what if i wanted to make the ranges diferent.· For instance, i would like to say
if x >= 6900 but·Less than·7000 then A
if x >=·7000 then B
if x <= 6500 but grater than 6400 then C
if x<= 6400 then D
How would this be written?· Thanks guys
·would it be put into a lookup or lookdown table?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
It's Only A Stupid Question If You Have Not Googled It First!!
SELECT X
CASE X <= 6500
· GOSUB UP
CASE X >= 6900
· GOSUB DOWN
CASE ELSE
· DEBUG CR, "······ ECenter"
· pw = 750
· S_Chan = cha
· S_Speed = rb
· GOSUB SendIt
ENDSELECT
But what if i wanted to make the ranges diferent.· For instance, i would like to say
if x >= 6900 but·Less than·7000 then A
if x >=·7000 then B
if x <= 6500 but grater than 6400 then C
if x<= 6400 then D
How would this be written?· Thanks guys
·would it be put into a lookup or lookdown table?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
It's Only A Stupid Question If You Have Not Googled It First!!
Comments
· SELECT x
··· CASE 0 TO 6400
····· ' task d
··· CASE 6401 TO 6500
······'·task c
··· CASE 6900 TO 6999
····· ' task·a
··· CASE >=7000
····· ' task·b
··· CASE ELSE
····· ' value out of range
· ENDSELECT
Note: I used x to match your code but using single-letter variables in programming is really bad form.·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax