Proc

From BR Wiki
Jump to navigation Jump to search

The Proc command opens and begins execution of a procedure file.

Comments and Examples

BR automatically closes the most recently executed, active procedure file before opening and executing the procedure file specified with the PROC command. If a procedure is executed from a sub-procedure, the calling sub-procedure is canceled, but its parent remains active.

The following command causes the procedure file PROCNAME, located on drive B, to be opened and executed:

PROC B:PROCNAME

The next command starts execution of the procedure file START. The asterisk prevents F2 logging of the commands within START.

PROC *START

Syntax

PROC {ECHO|NOECHO|<proc name>|*<proc name>}

Defaults

  1. Log procedure commands for recall by the F2 key

Parameters

The ECHO parameter reverses the affects of the PROC NOECHO command.

The NOECHO parameter prevents procedure lines from being displayed on the screen as they are executed. This command will apply to all procedures until PROC ECHO is entered or until Business Rules is exited.

The procedure file name parameter identifies the procedure file to be opened and executed. When procedure file name is preceded by an asterisk *, command logging will be turned off. Thus pressing of the F2 key will recall the PROC command, but not the commands in the procedure.

Technical Considerations

  1. If an error occurs while PROC NOECHO is active, F2 and F3 can be used to recall and display the error-causing command.
  2. ALERT commands which are executed while PROC NOECHO is active will not be displayed on the screen. The operator must press F2 or F3 to view the message. Use of PROC ECHO before and PROC NOECHO after the ALERT command is recommended to avoid this situation.
  3. Each open procedure file counts as one open file against the operating system limit on open files.
  4. Business Rules closes a procedure before executing the last line in the procedure. This eliminates procedure stacking (and an added open file) in situations such as when one procedure ends with a SUBPROC command to call another procedure, or when RUN is the last command in a procedure, or when a procedure has only one command.
  5. As the procedure file is closed before the last command is executed, the last command cannot be a SKIP to branch back to an earlier part of the procedure. If you want to end with an option to branch backward, you must add another line (such as a blank line or a remark) to keep the procedure file open.
  6. Procedure files with names that end in a .$$$ extension will automatically delete themselves when they close. (This feature applies only to procedure files.)

See also Free's Technical Considerations.


See Also

CLEAR PROC command.