Indigo Rose Software
  #1  
Old 11-13-2003
rhosk's Avatar
rhosk rhosk is offline
Indigo Rose Customer
 
Join Date: Aug 2003
Location: Maine, USA
Posts: 1,692
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.
__________________
Regards,

-Ron

Music | Video | Pictures
Reply With Quote
  #2  
Old 11-13-2003
TJ_Tigger's Avatar
TJ_Tigger TJ_Tigger is offline
Indigo Rose Customer
 
Join Date: Sep 2002
Location: Sol 3
Posts: 3,188
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.
Reply With Quote
  #3  
Old 11-13-2003
Lorne's Avatar
Lorne Lorne is offline
Indigo Rose Staff Member
 
Join Date: Feb 2001
Location: Indigo Rose Software
Posts: 2,588
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
Reply With Quote
  #4  
Old 11-13-2003
Brett's Avatar
Brett Brett is offline
Indigo Rose Staff Member
 
Join Date: Jan 2000
Posts: 2,001
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();
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT -6. The time now is 12:11 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright © 2000 - 2009 Indigo Rose Corporation. All rights reserved.
Indigo Rose Software