Call (Transfer Program Control)

The Call statement is used to transfer program control from the main program to a CRBasic subroutine.

Syntax

Call Name( Arguments )

Remarks

Use of the Call keyword when calling a subroutine is optional. If Call is used and Arguments are being passed to the subroutine, the Arguments must be enclosed in parentheses.

Parameters

Call

Call is an optional keyword used to transfer program control to another procedure.

Name

The name for the subroutine. The name is limited to 39 characters.

Type: Alphanumeric

For the Call statement, the Name parameter is the name of the procedure to call.

Arguments

The values to be passed to the subroutine (the variables can be Float, Long, or String; if not specified Float is assumed). The values are passed in the order listed.

Type: Constant, Variable, Array, or Expression

For the Call statement, the Arguments are variables, arrays, or expressions that should be passed to the subroutine. CRBasic passes all arguments into a subroutine by reference (that is, a reference to the memory location of the variable is passed, rather than an actual value). Therefore, if the value of an argument is changed by the subroutine, the change will take effect in the main program as well.