Please enable JavaScript to view this site.

Updated February 2024

{PRIVATE} PROCEDURE procname(var1{=defval} {as <typsiz>{:<mod},...varN{=defval} {as <typsiz>{:<mod})

   <optional local MAP statements, with optional STATIC prefix>

   <optional XGETARGs>

   <nearly any kind of statements>

   XPUTARG n,<expression>    ! return (1 or more) parameters

ENDPROCEDURE

 

Notes

Procedures are exactly like User-Defined Functions except they:

Do not return any value and thus cannot be used as expressions.
Cannot be given names starting with FN' (which is used exclusively for functions).
Use slightly different but parallel keywords: PROCEDURE, ENDPROCEDURE, EXITPROCEDURE vs. FUNCTION, ENDFUNCTION, EXITFUNCTION.

To call the procedure, use a form of the CALL statement:

CALL procname(var1,...varn)  

Note that functions can also be called in the same way, and their return values can be ignored, so there is no actual need for procedures at all, and many programmers just use functions exclusively.

History

2016 August, A-Shell 6.3.1523, compiler edit 770:  Add private attribute for functions and procedures.

2014 January, A-Shell 6.1.1373: Named parameters implemented in A-Shell.

Created with Help+Manual 9 and styled with Premium Pack Version 5 © by EC Software