Skip to content

MvFUNCRETURN#


An alias for MvFUNCTIONRETURN, exits a function and optionally returns a value.

Syntax
<MvFUNCRETURN VALUE = "{ expression } | literal"> 

Attributes#

Attribute Description
VALUE Optional value to return from a user defined function. If not value is being return it may be omitted.

Examples#

In this example if invalid parameters are passed to the the function returns without doing anything otherwise it returns the parameter value added together.

<MvFUNCTION NAME="add" PARAMETERS="num1, num2" STANDARDOUTPUTLEVEL="html,text">
    <mvIF EXPR="{NOT l.num1 OR NOT l.num2}">
        <MvFUNCTIONRETURN>
    </mvIF>
    <MvFUNCTIONRETURN VALUE="{ l.num1 + l.num1 }">
</MvFUNCTION>

Optionally, if a function does not a return a value <MvFUNCTIONRETURN> may be omitted.

<MvFUNCTION NAME="salutation" PARAMETERS="name, title" STANDARDOUTPUTLEVEL="html,text">
    Sincerely Yours,<br><br>
    <MvEVAL EXPR="{ l.name }"><br>
    <br>
    <MvEVAL EXPR="{ l.title }"><br>
</MvFUNCTION>