CALL Statement

Previous  Next

 

ret = CALL module( arg1, arg2... )

ret = CALL module@func( arg1, arg2... )

ret = CALL func( arg1, arg2... )

CALL sub( arg1, arg2...)

 


 

Calls a module, function or sub.  A sub or function can be local to current scope/program or an external function in another module.  In this case it is called using the module@function  syntax unless using an alias.  Call may be omitted when calling a function or sub.  Module, functions and subs must have been loaded and declared in order to be called.

 

Tech Note; You can't call a function as an external function from within the same module.  For example, the function Pelle in module MM in the example below, can't call another function in module MM using the mm@funcname syntax.  It must be called be called as funcname only.

 

Examples:

 

' Initialize the module MM before callin any functions

CALL mm

 

' Call subroutine Pelle in module MM

CALL mm@pelle( 2, 3 )

 

' Call function Nils and store the return value in ret

DIM ret AS INTEGER

ret = CALL nils()