11
« on: September 10, 2014, 01:29:06 AM »
Hi,
I have written that long script a while ago, which consists of a lot of gotos depending from a hotkey and calls a sub, which itself calls other subs too.
Now goto has determined as "bad" especially if one tries to adapt the script to OpenEUO.
00:
gosub task N E S W 00 01 11 21 00
21:
gosub task N E E S 21 210 211 212 213
210:
gosub task E N S W 210 210 210 21 99
212:
gosub task N S E W 212 212 212 21 99
213:
gosub task N E W S 213 213 213 21 99
...
halt
main:
The sub task does something, the result is read by the operator on the screen and entered via hotkey to call the sub task again with different parameters.
Depending from the entered hotkey the sub would issue an goto %x, where x is the position of the parameter containing the next tag to goto. My thinking now is, that it could be a way, to create simply subs instead of the tags and name them i.e. sub 21.
sub 21
gosub task N E E S 21 210 211 212 213
return
This however means, all subs would be started from within sub 00 and therefore create a hierarchy of cascaded, never really closed subs (unless the script comes to its planned halt within one of these subs).
The question now is: Is there a limit, how deep such cascade can be or a better idea to address the various parameter levels?
Greetings
TaskForce