REQUIRE ONCE()
Contents
Purpose
Load a Lianja C Extensions API, a Lianja procedure library or a JavaScript (.js), PHP (.php) or Python (.py) file
Syntax
REQUIRE_ONCE(<expC>)
See Also
ACLASS(), ADDPROPERTY(), AMEMBERS(), CLOSE PROCEDURE, COMPOBJ(), CREATEOBJECT(), DEFINE CLASS, DISPLAY CLASSES, DO, DODEFAULT(), FOREACH, FUNCTION, INCLUDE(), INCLUDE_ONCE(), LIST CLASSES, LIST PROCEDURE, LOADOBJECT(), NEWOBJECT(), OBJECT(), PARAMETERS, PRINT_HTML(), PRINT_JSON(), PRINT_R(), PRINT_XML(), PROCEDURE, REMOVEPROPERTY(), REQUIRE(), SAVEOBJECT(), SQL SELECT, SET CLASSLIB, SET LIBRARY, SET PROCEDURE, WITH
Description
The REQUIRE_ONCE() function opens the specified library file if it is not already open, scans the contents of it, and records the names and positions of the procedures and/or classes defined within it. The <expC> is the name of the library file, which can be a Lianja API or Lianja procedure library file or a JavaScript (.js), PHP (.php) or Python (.py) file. If the file extension is not stated, '.so' is assumed on Linux. To load a Lianja procedure or class library file, the '.prg' or '.dbo' file extension must be included. To load a library that is not in the current directory, the full path must be included. You can place as many classes or procedures as you want in a library file.
The SET LIBRARY TO command, without any filename specified, closes all active C Extensions 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 C Extensions library file.
The SET PROCEDURE and CLOSE PROCEDURE commands can also be used to handle Lianja procedure library files.
The active procedures and functions can be listed with the LIST or DISPLAY PROCEDURE commands.
Example
// Open Samples.so C extension API procedure library require_once("Samples") // Close pdf.so C extension API procedure library release library pdf.so // Close all active C extension API procedure library files set library to