ENDFUNCTIONS        End function declaration section

<< Click to Display Table of Contents >>

Navigation:  Robo-FTP User's Guide > Script Programming > Script Commands > All Script Commands >

ENDFUNCTIONS        End function declaration section

Syntax:

ENDFUNCTIONS

 

Arguments:

None

 

Options:

None

 

 

 

This script directive is used to mark the ending 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 BEGINFUNCTIONS command is used to mark the beginning 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): BEGINFUNCTIONS, ENDFUNCTION, FUNCTION, RETURN

See also: Using Functions