BEGINFUNCTIONS        Begin function declaration section

Top  Previous  Next

Syntax:

BEGINFUNCTIONS

 

Arguments:

None

 

Options:

None

 

 

 

This script directive is used to mark the beginning of a function declaration section in a command script. All functions must be declared inside a function declaration section and all functions must be declared before they are called. The ENDFUNCTIONS command is used to mark the end of a function declaration section.

 

Here is a example of a function declaration section containing two simple function definitions:

 

BEGINFUNCTIONS

FUNCTION MyFunction

 ;; body of MyFunction

 RETURN

ENDFUNCTION

FUNCTION YourFunction

 ;; body of YourFunction

 RETURN

ENDFUNCTION

ENDFUNCTIONS

 

Those functions declared above don't actually DO anything. The purpose of this example is merely to show how a single function declaration section may contain multiple function definitions.

 

It is possible for a script to contain multiple function declaration sections but if an existing function is subsequently redefined then the new definition replaces the original function definition. In other words, Robo-FTP does not support function overloading.

 

IMPORTANT

To avoid confusion, it is probably best to declare all of your functions in a single section at the beginning of your script file.

 

 

Related command(s): ENDFUNCTIONS, FUNCTION, ENDFUNCTION, RETURN

See also: Using Functions