CONTENTS | PREV | NEXT
6A. proc definition and arguments (PROC)
----------------------------------------

You may use PROC and ENDPROC to collect statements into your own functions.
Such a function may have any number of arguments, and several return values.

PROC, ENDPROC

syntax:		PROC <label> ( <args> , ... )
		ENDPROC <returnvalue>, ...

defines a procedure with any number of arguments. Arguments are of type LONG
or optionally of type PTR TO <type> (see  8B ) and need no further
declaration. The end of a procedure is designated by ENDPROC. If no
return value is given, 0 is returned. Example: write a function that
returns the sum of two arguments:

PROC add(x,y)         /* x and y are local variables */
ENDPROC x+y           /* return the result  */

a short version:

PROC add(x,y) IS x+y