You can use JSL classes to create objects, providing definitions for member variables, methods, and functions. The JSL function Define Class() has a number of arguments that define the contents of the class:
•
|
"class name" is the name of the class being defined.
|
•
|
"base class name" are one or more class names that make the set of base classes that are used as the foundation of the class being created.
|
•
|
namespace defines a specific namespace that stores unscoped variables defined in methods and functions.
|
•
|
Show defines the value that appears when a class object is written out using the Show(), Print(), or Write() functions. Options include:
|
‒
|
All (Boolean) shows all members, methods, and functions defined in a class object instance. The default value for All is true.
|
‒
|
Members (Boolean) shows all member variables contained in a class object instance.
|
‒
|
Methods (Boolean) shows all methods contained in a class object instance.
|
‒
|
Functions (Boolean) shows all functions contained in a class object instance.
|
注意:You can specify either the All option or any number of the Members, Methods, and Functions options, but you cannot specify both options at the same time.
注意:Statements can be separated by either a comma or semicolon, but must be done consistently within the Define Class() function.
•
|
To override what contents should be shown, a class object is displayed using the Show(), Print(), or Write() function and defining a show Method() that returns a value to be used.
|
•
|
In cases when a string representation is needed, such as a Char() function or concatenation operator, define a To String method that will return a string result to be used.
|