Section 9. Program Control Instructions
9-6
Call
The Call statement is used to transfer program control from the main program
to a subroutine.
Syntax
Call
Name
(
List of Variables
)
Remarks
Use of the Call keyword when calling a subroutine is optional.
The Call statement has these parts:
Part Description
Call
Call is an optional keyword used to transfer
program control to a subroutine..
name
The Name parameter is the name of the
subroutine to call.
List of Variables or Constants
The list may contain variables, constants, or
expressions that evaluate to a constant (i.e., do
not contain variable) that should be passed into
the variables declared in the subroutine.
Values of variables passed can be altered by
the subroutine. If the subroutine changes the
value of the subroutine declared variable, it
changes the value in the variable that was
passed in. If a constant is passed to one of the
subroutine declared “variables”, that “variable”
becomes a constant and its value cannot be
changed by the subroutine.
You are never required to use the
Call
keyword when calling a subroutine. If
you use the
Call
keyword to call a procedure that requires
arguments
, the
arguments
list must be enclosed in parentheses. If you omit the
Call
keyword,
you also must omit the parentheses around the
arguments
list.
You can pass
arguments
to a procedure by reference or by value. Values of
arguments
passed by reference can be altered by the procedure when the
arguments
are returned; CRBasic supplies the actual address of the
argument
.
Call Statement Example
See Sub description in Section 5.
Call Table
Used to call a data table.
Syntax
CallTable
Name
Remarks
Calls DataTable that has been declared above BeginProg. When the DataTable
is called, it will process data as programmed and check the output condition.
CallTable Example
This example uses CallTable to transfer program control to the ACCEL table.
CallTable
ACCEL
Summary of Contents for CR9000
Page 6: ...CR9000 Table of Contents iv This is a blank page ...
Page 22: ...CR9000 Overview OV 16 This is a blank page ...
Page 26: ...Section 1 Installation 1 4 CR9000 FIGURE 1 1 3 CR9000 Battery Pack ...
Page 72: ...Section 3 CR9000 Measurement Details 3 28 This is a blank page ...
Page 88: ...Section 5 Program Declarations 5 6 This is a blank page ...
Page 217: ...This is a blank page ...