The return statement is used inside a function to set the value
of the function. This is the value returned by the call of the function.
A function can only return one value. If no value is assigned during the
function call, then the function has a default value of an empty string
"". Therefore, a called function always returns a value, even if it is
just an empty string.
Note that once the return is executed, you immediately leave the
function and return to where the function call was made from within the
code. The function will now have the value that was returned and you can
assign that value to a named variable (use the var statement to
initialize the variable).
Code for ReturnExample.wml
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
return = $(rand)
Code for ReturnExample.wmls
extern function findreturn()
var ran = findrandom();
extern function findrandom()
Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.