The RETURN statement behaviour can be grouped into the following:

Inside a Function

A return statement used inside a SunSed function will stop the current function's execution and returns the return statement's argument as the return value of the function.

SECTION function -> user:is_over_21 {
        purpose  ~> Checks if user is over 21
        tags     ~> 
        access   ~> private
        stable?  ~> No
        schedule ~> 
        examples ~>

        #=> FALSE 

    user:is_over_21 = ƒ($age){
        IF($age > 21) {
            RETURN TRUE
        } ELSE {
            RETURN FALSE

Outside of a Function

When executed outside of a function, the RETURN statement will stop the SunSed code from running.

Copyright ©2013-2022 SunSed®. All rights reserved.