function Statement

Top  Previous  Next

Declares the name, arguments and statements of a function procedure.

Syntax

Function name [(variable1), (variable2), (variable3)]

   [statements]

   [expression statements]

End Function

Description

When function name is called, the list of variables (variable1, variable2, variable3) is passed to the function procedure, statements are executed and expression statements return the value of the function.

Remarks

To return a value from a function, assign the function name to a variable. You can also return a function value without storing it, using the Net.write(function name) command.

Examples

function f(a,b)

{

return a*b;

}

Net.write(f(4,3));// Returns 12