SET CLASSLIBRARY

From Recital Documentation Wiki
Jump to: navigation, search

Deprecated in Recital 10 - see REQUIRE_ONCE()

Purpose

Open one or more class library files


Syntax

SET CLASSLIBRARY TO [<.cls filename> | (<expC>) [ADDITIVE]]


See Also

CLASS, DISPLAY CLASSES, LIST CLASSES, REQUIRE_ONCE(), SET COMPILE, SET DEVELOPMENT


Description

The SET CLASSLIBRARY TO <.cls filename> command opens the specified class library file, scans the contents of it, and records the names and positions of the classes 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 classes as required in a class library file.

The settings of SET COMPILE and SET DEVELOPMENT (and Operating System permissions and disk space) will determine whether class library files are automatically compiled when the SET CLASSLIBRARY TO command is issued. Compiled class libraries have a ’.clo’ file extension.

If the optional ADDITIVE keyword is specified then any class libraries that are already open are left open and the new class library is added. Without the ADDITIVE keyword, existing class libraries will be closed when a new library is opened with the SET CLASSLIBRARY command. You can open up to 20 class library files at any one time. The SET CLASSLIBRARY TO command, without any <.cls filename> specified, closes all active class library files. A closed library file discards any knowledge of where the classes within reside.

Classes are declared by the CLASS keyword followed by the class name. The ENDCLASS statement denotes the end of a class definition. No syntax checking is carried out while the class library file is being scanned. The syntax checking is only carried out when the class is instantiated. The active classes can be listed with the LIST | DISPLAY CLASSES command.


Example

// myclasslib.cls
class myclass
...
endclass
 
class myotherclass
...
endclass
// End of myclasslib.cls
 
set classlibrary to myclasslib
myobject = new myclass()
myobject2 = new myotherclass()

Products

Recital Server, Recital