^return[]
^return[result value]
If called force finishes a Parser method execution, in which the ^return[] call code is written. The result of the method will be what was output before the ^return[] call or the current value of $result variable. The call ^return[result value] is equivalent to $result[result value]^return[]. To return an empty string use ^return{}.
@check[value;exit]
Value: $value ^if($value eq 'bad'){ $exit } -passed- Outputs:
Value: good -passed-
Value: normal -passed-
Value: bad -return-
Note: ^return[] call code is written in the @main[] method, so the return is made from it. To do this, the execution of the @check[] method is also terminated, so there is no -passed- for the value bad in the output.