function

Syntax

function functionName ( optionalParameters )

Description

These commands will declare a user defined function within your program. User functions work in the same way normal commands work. They can accept multiple parameters and return values in the same manner, allowing you to create customized commands within your program.

Example

rem example 1
do
    myFunction ( )
loop

function myFunction ( ) print ( "inside myFunction" ) endfunction
rem example 2 do myFunction ( 1, 2, 3 ) loop
function myFunction ( a, b, c ) print ( a ) print ( b ) print ( c ) endfunction