Tell me what you want, What you really, really want.

Moderator: Mmiscool

User avatar
By Oldbod
#55155 I think this is brilliant and just what i was looking for in another language. Is there any error handling for it? I think i feel a feature request coming on....
Last edited by Oldbod on Thu Sep 15, 2016 6:30 am, edited 1 time in total.
User avatar
By livetv
#55211 Thanks! That is what I had in mind. Does this work with expressions as well?

ex: gosub word("[Option1] [Option2] [Option3]", option)

I'll go and find out anyway but wanted to plant that notion in case not.
User avatar
By bugs
#55224 That does work:-
Code: Select all
for option = -1 to 4
 gosub word("[Option1] [Option2] [Option3]", option)
 next option
end

[Option1]
print "option1"
return

[Option2]
print "option2"
return

[Option3]
print "option3"
return


and it catches the deliberate boundary errors too!

Error at line 4: Gosub Label not found:
Error at line 4: Gosub Label not found:
option1
option2
option3
Error at line 4: Gosub Label not found:
Done...

:D