Eg: If option = 1 then gosub [option1]
Elseif option = 2 then gosub [option2]
Elseif option = 3 then gosub [option3]
' etc, etc...
Elseif option = 9 then gosub [option9]
Else print "invalid option"
Endif
Explore... Chat... Share...
Moderator: Mmiscool
gosub "[x" & word("Option1 Option2 Option3", option) & "]"
' NOTE TO SELF: Check to see that expressions work as well as variables, otherwise that has to be broken into two lines.
' Then subroutines would look like this:
[xOption1]
'code here
return
[xOption2]
'code here
return
[xOption3]
'code here
return
[x]
print "invalid option"
return
' Initialize the vector table only once
vtable$=" Greg:[boy] Marcia:[girl] Peter:[boy] Jan:[girl] Bobby:[boy] Cindy:[girl] Tiger:[dog] Mike:[dad] Carol:[mom]"
' :
' code continues
' :
person= msgget("visitor")
place=instr(vtable$," " & person & ":")
if place > 0 then vector$= word( mid(vtable$, place), 2,":") else vector$="[notfound]"
gosub vector$
' -- code continues --
' here we define subroutines [boy], [girl], [dog], [notfound]
It takes about 20-25 seconds for home assistant c[…]
I tried to upgrade tof my sonoff basic R2 with the[…]
a problem Perhaps you want to define "Probl[…]
Rebooting your router will not give you a faster I[…]
There are no other notifications from esptool.py i[…]
Using the Arduino IDE, you'll learn how to set up […]
In this project, you will post to Twitter using an[…]
In this project, we will build a water level contr[…]
I guess I'm late, but I had the same problem and f[…]
Last night I received my first D1 Minis for a lear[…]
Although I am aware that this is an old post, I fe[…]