REQUIRE ONCE()

From Recital Documentation Wiki
Revision as of 15:15, 9 December 2009 by Yvonnemilne (Talk | contribs)

Jump to: navigation, search

Template:YLM to do Add class library loading


Purpose

Load a Recital class or procedure library or a C extension library built with the Recital SDK


Syntax

REQUIRE_ONCE(<expC>)


See Also

CLOSE PROCEDURE, DO, FUNCTION, LINK, LIST PROCEDURE, PARAMETERS, PROCEDURE, RELEASE LIBRARY, REQUIRE(), SET LIBRARY


Description

The REQUIRE_ONCE() function opens the specified API or 4GL procedure library file if it is not already open, scans the contents of it, and records the names and positions of the procedures defined within it. The <expC> is the name of the library file. If the file extension is not stated, '.dll' is assumed on Windows and '.so' on UNIX/Linux. To load a 4GL library file, the '.prg' or '.dbo' file extension must be included. You can place as many procedures as you want in a procedure library file. By default, library files are loaded from the sharedlib directory: usually <Program Files>\Recital\sharedlib on Windows and /opt/recital/extensions on UNIX/Linux, but defined in the DB_LIBDIR Registry setting / environment variable. To load a library that is not in the current directory or the sharedlib directory, the full path must be included.

The SET LIBRARY TO command, without any filename specified, closes all active API procedure library files. A closed library file discards any knowledge of where the procedures within reside. The RELEASE LIBRARY <library filename> command can be used to close an individual API library file.

The SET PROCEDURE and CLOSE PROCEDURE commands can also be used to handle Recital/4GL procedure library files.

The active procedures and functions can be listed with the LIST or DISPLAY PROCEDURE commands.

For full details on using the Recital SDK, please see the SDK documentation.


Example

// Open Samples.so API procedure library
require_once("Samples")
// Close pdf.so API procedure library
release library pdf.so
// Close all active API procedure library files
set library to


Products

Recital, Recital Server