Return Statement Example
Previous Topic  Next Topic 

Below are some examples of the return statement:



func f()

    // This returns the result of the expression 3*2

    return 3*2;

endfunc



func g()

    // This returns the string "123"

    return "123";

endfunc



func h()

    // This returns the empty str ""

   return;

end



Note it is not illegal to return a value from the onsignal function, but the return value will be ignored lost when control is returned to the main program.    Therefore it is more correct to just use a return statement without a return expression:


onsignal

    return;

endonsignal