Announcement

Collapse
No announcement yet.

Question about break in ams

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Question about break in ams

    How do I break out of a function without using return? or do I just have to return nil?

    in php if you can use end to break out of the function without been in a loop is there not function like this for ams, I used AMS for years always asking myself thing but never thought about asking the forum.

    so lets say we have

    Code:
    function abc(s_string)
        if s_string == nil or s_string == '' then
            Dialog.Message('', 'somemessage');
        end
    
        -- more code here
    end
    I know I could return the dialog
    Code:
    return Dialog.Message('', 'somemessage');
    or
    Code:
    return nil
    But the way I see it there should be a command to end the script without returning anything at all not even nil
    Plugins or Sources MokoX
    BunnyHop Here

  • #2
    'return' terminates the function then optionally returns what you tell to to in other words return is the command to end the script without returning anything at all not even nil .

    Comment

    Working...
    X