Call                                                                                                          Statement

 

CALL subName(argList)

 

Description

Transfer control to another subroutine. The argList contains a list of arguments separated by commas that are parameters passed to the called subName. Arguments may be used to pass data values to the called program or to specify the names of variables that are to be given new values by the called program.

 

Arguments in the list may be an expression if the argument is passing data to the called program. The expression will be calculated and the resulting value will be passed to the called routine.

 

There must be a one-to-one correspondence between the number of arguments in argList and the number of arguments the called subroutine is expecting as defined in its SUB definition statement. Arguments should also be the same type(string, float,etc) as the called program is expecting. The names of arguments in argList does not have to be the same as the names of arguments defined in the called program because arguments are matched up by position in the calling argList.

 

Subroutines cannot be inside another subroutine or function.

 

Example

  ...

  Call PayrollRoutine(Salary, Deductions, NoDependents, NetSalary)

End Sub

 

Sub PayrollRoutine(Sal as Float, Deduct as Float, NoDepends as Integer, Net as Float) 

  Let Net=Sal-Deduct

End Sub