Difference between revisions of "REQUIRE ONCE()"
Yvonnemilne (Talk | contribs) |
Yvonnemilne (Talk | contribs) |
||
(9 intermediate revisions by one user not shown) | |||
Line 1: | Line 1: | ||
− | |||
− | |||
− | |||
− | |||
− | |||
==Purpose== | ==Purpose== | ||
− | Load a Recital class or procedure library or a C extension library built with the Recital | + | Load a Recital class or procedure library or a C extension library built with the Recital API |
Line 13: | Line 8: | ||
==See Also== | ==See Also== | ||
− | [[CLOSE PROCEDURE]], [[DO]], [[FUNCTION]], [[LINK]], [[LIST PROCEDURE]], [[PARAMETERS]], [[PROCEDURE]], [[ | + | [[ACLASS()]], [[ADDPROPERTY()]], [[AMEMBERS()]], [[CLASS]], [[CLASS - Methods]], [[CLASS - Parameters]], [[CLASS - Properties]], [[CLASS - Scoping]], [[CLOSE PROCEDURE]], [[COMPOBJ()]], [[CREATEOBJECT()]], [[DEFINE CLASS]], [[DISPLAY CLASSES]], [[DO]], [[DODEFAULT()]], [[FOREACH]], [[FUNCTION]], [[INCLUDE()]], [[INCLUDE_ONCE()]], [[LINK]], [[LIST CLASSES]], [[LIST PROCEDURE]], [[LOADOBJECT()]], [[METHOD]], [[NEWOBJECT()]], [[OBJECT()]], [[PARAMETERS]], [[PRINT_HTML()]], [[PRINT_JSON()]], [[PRINT_R()]], [[PRINT_XML()]], [[PROCEDURE]], [[REMOVEPROPERTY()]], [[REQUIRE()]], [[SAVEOBJECT()]], [[SQL SELECT]], [[SET CLASSLIBRARY]], [[SET LIBRARY]], [[SET PROCEDURE]], [[WITH]] |
==Description== | ==Description== | ||
− | The REQUIRE_ONCE() function opens the specified | + | The REQUIRE_ONCE() function opens the specified Recital class or procedure library or C Extensions 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. If the file extension is not stated, '.so' is assumed on UNIX/Linux. To load a Recital 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. |
+ | |||
+ | C Extensions libraries in the shared library directory are loaded automatically at the start of a Recital process. The shared library directory location is defined by the DB_LIBDIR environment variable in the [[Configuration Files|recital.conf]] file. | ||
− | The SET LIBRARY TO command, without any filename specified, closes all active | + | 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 Recital | + | The SET PROCEDURE and CLOSE PROCEDURE commands can also be used to handle Recital procedure library files. |
The active procedures and functions can be listed with the LIST or DISPLAY PROCEDURE commands. | The active procedures and functions can be listed with the LIST or DISPLAY PROCEDURE commands. | ||
− | For full details on using the Recital | + | For full details on using the Recital C Extensions API, please see the [[:Category:SDK|C Extensions API documentation]]. |
==Example== | ==Example== | ||
<code lang="recital"> | <code lang="recital"> | ||
− | // Open Samples.so API procedure library | + | // Open Samples.so C extension API procedure library |
require_once("Samples") | require_once("Samples") | ||
− | // Close pdf.so API procedure library | + | // Close pdf.so C extension API procedure library |
release library pdf.so | release library pdf.so | ||
− | // Close all active API procedure library files | + | // Close all active C extension API procedure library files |
set library to | set library to | ||
</code> | </code> | ||
Line 43: | Line 40: | ||
[[Category:Documentation]] | [[Category:Documentation]] | ||
[[Category:Functions]] | [[Category:Functions]] | ||
+ | [[Category:Objects]] | ||
+ | [[Category:Objects Commands]] | ||
+ | [[Category:SDK]] | ||
+ | [[Category:Applications]] | ||
+ | [[Category:Applications Commands]] |
Latest revision as of 14:01, 12 March 2010
Purpose
Load a Recital class or procedure library or a C extension library built with the Recital API
Syntax
REQUIRE_ONCE(<expC>)
See Also
ACLASS(), ADDPROPERTY(), AMEMBERS(), CLASS, CLASS - Methods, CLASS - Parameters, CLASS - Properties, CLASS - Scoping, CLOSE PROCEDURE, COMPOBJ(), CREATEOBJECT(), DEFINE CLASS, DISPLAY CLASSES, DO, DODEFAULT(), FOREACH, FUNCTION, INCLUDE(), INCLUDE_ONCE(), LINK, LIST CLASSES, LIST PROCEDURE, LOADOBJECT(), METHOD, NEWOBJECT(), OBJECT(), PARAMETERS, PRINT_HTML(), PRINT_JSON(), PRINT_R(), PRINT_XML(), PROCEDURE, REMOVEPROPERTY(), REQUIRE(), SAVEOBJECT(), SQL SELECT, SET CLASSLIBRARY, SET LIBRARY, SET PROCEDURE, WITH
Description
The REQUIRE_ONCE() function opens the specified Recital class or procedure library or C Extensions 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. If the file extension is not stated, '.so' is assumed on UNIX/Linux. To load a Recital 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.
C Extensions libraries in the shared library directory are loaded automatically at the start of a Recital process. The shared library directory location is defined by the DB_LIBDIR environment variable in the recital.conf 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 Recital 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 C Extensions API, please see the C Extensions API documentation.
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
Products
Recital, Recital Server