Post Reply 
GO TO? JUMP? [Solved]
11-26-2015, 12:05 AM (This post was last modified: 11-26-2015 01:31 AM by ji3m.)
Post: #9
RE: GO TO? JUMP?
Not quite a go to but a jump table way(or should i say call table)

SUB1 () begin .. end ;
...
SUB6 () begin end;


//somewhere in your code
//mx is mouse x position

local jmplist := {'SUB1', 'SUB2', ... 'SUB6'};

// then
....
eval( jmplist ( IP (mx/51) ) ); // a call to one of the subs

//return is here
...
This works nicely for function with no arguments.
The single quotes on the func names are crucial.

I work with android Prime only for now on my
Galaxy Tab Pro/Note 2
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
GO TO? JUMP? [Solved] - jrozsas - 11-25-2015, 03:08 PM
RE: GO TO? JUMP? - Didier Lachieze - 11-25-2015, 03:22 PM
RE: GO TO? JUMP? - Han - 11-25-2015, 03:29 PM
RE: GO TO? JUMP? - jrozsas - 11-25-2015, 04:47 PM
RE: GO TO? JUMP? - primer - 11-25-2015, 05:03 PM
RE: GO TO? JUMP? - jrozsas - 11-25-2015, 05:17 PM
RE: GO TO? JUMP? - jrozsas - 11-25-2015, 05:27 PM
RE: GO TO? JUMP? - jrozsas - 11-25-2015, 05:29 PM
RE: GO TO? JUMP? - ji3m - 11-26-2015 12:05 AM



User(s) browsing this thread: 1 Guest(s)