|
#1
|
||||
|
||||
|
labels in 5.0
This may be a dumb question, sorry, but how do you return to labels with this new syntax. I'm melding into the changes here slowly, but I can't figure out how to "goto" a label in this thing - don't laugh! 4.0 was so simple comparitively. I'm sure it's a quick easy answer, but would you please enlighten? Thanks much.
|
|
#2
|
||||
|
||||
|
The language that IR used in AMS 5.0 does not have a native goto (unconditional jump) function that I am aware of. Nor does it have a RETURN function. The term RETURN is part of the programming language but not used in the same way. What I have been doing to get around this is to nest IF statements. It takes a little for me to think it out but it works quite well.
If there is a way to apply GOTO statements and Lables or the RETURN break let me know. |
|
#3
|
||||
|
||||
|
There's a trick you can do to break from an event: the break command is only allowed within a loop. So, just turn your whole event into a 1-step loop, and you have instant breakability.
Like so: Code:
do
-- bunch of stuff goes here
if bTest == TRUE then
break;
end
-- more stuff here
until true
|
|
#4
|
||||
|
||||
|
Another method is to use a function and then just do a return when you want to break out:
Code:
-- Define a worker function
function temporary()
-- bunch of stuff goes here
if bTest == TRUE then
return;
end
-- more stuff here
end
-- Now call it
temporary();
|
![]() |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
All times are GMT -6. The time now is 12:11 AM.








Linear Mode
