-->
Page 2 of 3

Re: switch / case statements

PostPosted: Wed Sep 14, 2016 8:19 pm
by Mmiscool
Ok.

Just posted up a new build.

See the following demonstration program.

You can now goto the branch name contained in a variable.

Code: Select alllistbox test$, "[test1],[test2]"
button "go", [go]
wait

[go]
goto test$
wait


[test1]
print "1"
wait

[test2]
print "2"
wait


Re: switch / case statements

PostPosted: Wed Sep 14, 2016 8:22 pm
by Ecoli-557
Great Mike!
That gives me some cool ideas.
Regards.

Re: switch / case statements

PostPosted: Thu Sep 15, 2016 1:10 am
by Electroguard
I also agree, the ability to branch differently depending on data is a great idea, and gives a partial equivalent to being able to pass variables.

Re: switch / case statements

PostPosted: Thu Sep 15, 2016 5:24 am
by Mmiscool
This will also work with gosub. Forgot to mention that.