SET PROCEDURE

From Recital Documentation Wiki
Revision as of 17:13, 23 November 2009 by Helengeorge (Talk | contribs)

Jump to: navigation, search

Purpose

Open a procedure library file


Syntax

SET PROCEDURE TO [<.prg filename> | (<expC>) [ADDITIVE]]


See Also

CLOSE PROCEDURE, COMPILE, DISPLAY PROCEDURE, DO, FUNCTION, LINK, LIST PROCEDURE, PARAMETERS, PEXIST(), PROCEDURE, SET COMPILE, SET DEVELOPMENT


Description

The SET PROCEDURE TO <.prg filename> command opens the specified procedure library file, scans the contents of it, and records the names and positions of the procedures defined within it. The filename can be substituted with a <expC>, enclosed in round brackets, which returns a valid filename. You can place as many procedures as you want in a procedure library file.

The settings of SET COMPILE and SET DEVELOPMENT (and Operating System permissions and disk space) will determine whether procedure library files are automatically compiled when the SET PROCEDURE TO command is issued.

If the optional ADDITIVE keyword is specified then any procedures that are already open are left open and the new procedure library is added. You can open up to 10 procedure files at any one time. The SET PROCEDURE TO command, without any <.prg filename> specified, closes all active procedure library files. A closed library file discards any knowledge of where the procedures within reside. The CLOSE PROCEDURE command provides the same functionality. Closing a procedure file by a procedure defined within it has undefined results.

Procedures are declared by the PROCEDURE or FUNCTION keyword followed by the procedure name. The RETURN statement denotes the end of a procedure. RETURN statements can be used within the procedure provided they are used within DO...WHILE, DO...CASE, or IF...ELSE...ENDIF statements. No syntax checking is carried out while the procedure library file is being scanned. The syntax checking is only carried out when the procedure is executed. Procedure library files are supported by Recital to provide compatibility with dBASE. However, you can declare procedures anywhere in Recital programs. A procedure declaration must have been encountered before the procedure is executed with a DO command. The active procedures and functions can be listed with the LIST PROCEDURE command.


Example

set procedure to statistics
do std with "patrons", "seats"
set procedure to


Products

Recital Server, Recital</code>