Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 4 of 4

Thread: labels in 5.0

  1. #1
    Join Date
    Aug 2003
    Location
    Maine, USA
    Posts
    1,695

    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. #2
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    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. #3
    Join Date
    Feb 2001
    Location
    Indigo Rose Software
    Posts
    2,728
    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. #4
    Join Date
    Jan 2000
    Posts
    2,002
    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();

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts