PROGRAM (Statement)


Declare a program name.


PROGRAM <programname> [(<argument>[,<argument>...])]


This statement declares the character string specified by <programname> as a program name.
It should be put at the beginning of a program. If not, the file name is used as a program name.
<programname> can have up to 64 characters and its first character should be an alphabet.
Programs whose names are expressed in PROnumeral cannot be followed by <argument>. Only those programs can be executed from the operating panel or external devices.
<argument> is data passed from the calling side. Changing the value of <argument> passed by a CALL statement also changes the value of the variable specified as an argument at the calling side.
The <argument> type should be the same as that in the CALL statement.
The type is expressed using a suffix or AS expression.
PROGRAM SUB0 (aa%, bb!)
PROGRAM SUB0 (aa AS INTEGER, bb AS SINGLE)
If an array variable is used in <argument>, enter the maximum value of the array subscripts defined in the DIM statement as well as the number of subscripts.
This statement can have a maximum of 32 <argument>s.
Programs that can be started from an external device are limited to those having the program name <PRO_number>.



PROGRAM PRO1
'Declare PRO1 as a program name
PROGRAM SUB2 (la, lb%, lc#)
'Declare SUB2 having arguments of la, lb%, and lc#
'as a program
PROGRAM SUB3 (lb%(12, 5))
'Declare SUB3 as program and receive arguments
'with two-dimensional array lb%. In this example,
'the array subscripts are 12 and 5.
PROGRAM SUB0 (la%, lb!)
PROGRAM SUB0 (la As Integer, lb As Single)


Top