Procedures

{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 Dynamic Structure Functions (which see, for many details) except that they cannot be used as expressions, and they don't return an expression value. Like functions, or SBX routines, they can update any of the parameters passed. They also use similar but separate keywords:

FUNCTION        PROCEDURE

ENDFUNCTION     ENDPROCEDURE (also END FUNCTION and END PROCEDURE)

EXITFUNCTION    EXITPROCEDURE

 

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

CALL procname(var1,...varn)  

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.