Warning

You're browsing the old v2.x documentation. This version is no longer maintained. Click here to go the v3.x documentation.

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
proc [2019/06/13 20:55] – [Recursion] neilsproc [2020/08/07 08:52] (current) – Add note about naming thraka
Line 10: Line 10:
  
 The ''PROC'' command introduces a new procedure that spans until the ''ENDPROC'' command. Procedures are named subroutines that have a unique variable and label scope. Procedures may have one or more parameters that are passed to by the ''CALL'' command. The ''CALL'' command is the only way to execute a procedure (you can't ''GOTO'' into a procedure, for example). You can use ''RETURN'' to early exit a procedure. The ''PROC'' command introduces a new procedure that spans until the ''ENDPROC'' command. Procedures are named subroutines that have a unique variable and label scope. Procedures may have one or more parameters that are passed to by the ''CALL'' command. The ''CALL'' command is the only way to execute a procedure (you can't ''GOTO'' into a procedure, for example). You can use ''RETURN'' to early exit a procedure.
 +
 +The name of the procedure and the name of a parameter **can't** start with a command or directive name. For example, you can't define a procedure named ''repeatnumber'' as ''REPEAT'' is a command. Likewise, you can't name a parameter ''procparameter1'' as ''PROC'' is a directive.
  
 Example: Example: