User Tools

Site Tools


procedure_calls.htm
Navigation:  Language Reference > 2 - Program Source Code Format > Program Format >====== PROCEDURE Calls ====== Previous pageReturn to chapter overviewNext page

procname[(parameters)]

return = funcname[(parameters)]

blk2blue.jpg

procname The name of the PROCEDURE as declared in the procedure's prototype.
parameters An optional parameter list passed to the PROCEDURE. A parameter list may be one or more variable labels or expressions. The parameters are delimited by commas and are declared in the prototype.
return The label of a variable to receive the value returned by the PROCEDURE.
funcname The name of a PROCEDURE which returns a value, as declared in the procedure's prototype.

A PROCEDURE is called by its label (including any parameter list) as a statement in the CODE section of a PROGRAM or PROCEDURE. The parameter list must match the parameter list declared in the procedure's prototype. Procedures cannot be called in expressions.

A PROCEDURE which returns a value is called by its label (including any parameter list) as a component of an expression or parameter list passed to another PROCEDURE. The parameter list must match the parameter list declared in the procedure's prototype. A PROCEDURE which returns a value may also be called by its label (including any parameter list), in the same manner as a PROCEDURE which doesn't return a value, if its return value is not needed. This will generate a compiler warning that can be safely ignored (unless the PROC attribute is placed on its prototype).

If the PROCEDURE is a method of a CLASS, the procname must begin with the label of an object instance of the CLASS followed by a period then the label of the PROCEDURE (objectname.procname).

Example:

PROGRAM

MAP

ComputeTime PROCEDURE(*GROUP)     !Passing a group parameter

!PROCEDURE returning a value and passing no parameters:

MatchMaster PROCEDURE,BYTE,PROC

END

ParmGroup GROUP                   !Declare a group

FieldOne   STRING(10)

FieldTwo   LONG

     END

CODE

FieldTwo = CLOCK()               !Built-in procedure called as expression

ComputeTime(ParmGroup)           !Call the compute time procedure

MatchMaster()                    !Call the procedure as a procedure

See Also:

PROCEDURE

procedure_calls.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1