RETURN - return from current function


<RETURN [$value]>
or in version 8 and later syntax:
<RETURN [{$value ...}|(SQL-expression)]>

The <RETURN> statement ends the current function, optionally setting the value of $ret to its given argument. It can be used to end a function early when some condition or error is met.

In version 8 and later syntax - i.e. when the syntaxversion pragma (here) is 8 or more - the <RETURN> value can be a SQL expression (if given in parentheses) or multiple values, like a variable assignment. Note that attempting to use the parenthetical SQL-expression syntax in version 7 and earlier may result in a compilation error - or may silently succeed yet be interpreted as a literal "(...)" string, e.g. if no embedded variable parameters.

RETURN sets a return value if an argument is given.


<A NAME=update user>
  <SQL MAX=1 "select FullName from passwd where User = $user">
  <IF $loop eq 0>        <!-- no such $user: quit now -->
  ... continue to update the user ...

The RETURN statement was added in version 2.1.882300000 19971216.

BREAK, exit

Copyright © Thunderstone Software     Last updated: Apr 15 2024
Copyright © 2024 Thunderstone Software LLC. All rights reserved.