Implementation
Within the folder "implementation", you can view and edit the code for the Class definition that you
have opened. In this folder, each code section is represented by a subfolder. The left and right pane are
automatically synchronized, which means that the subfolder that is selected always represents the code section where
the cursor is positioned.
Class definitions contain the following code sections:
When doing a right mouse click, a popup menu will display options to customize the view, display additional information or to perform certain actions on the code.
By setting the pop down menu options "Show line number" and "Show revision", extra information may (or may not) be displayed before each code line. For "Show revision", there are several options provided. When the option "Revision" (or "All") is selected, there will be shown five asterisks (*****) before every new code line. Only after checking in the current revision, these asterisks will be replaced with the new revision number.
If an item name is selected, this popup menu will also display additional information for this item. When typing the name of an object or item, followed by a dot(.) the available properties, functions etc. will popup. This way it will be easier to complete the code. Selecting an option in the popup menu may provide additional information in a hint box.
The LION syntax itself is case insensitive. Nevertheless, this does not concern literals (including any kind of end user input) or system items that store an application specific name or property (like SI-CURRFORM, SI-REPNAME, SI-FOCUSEDFIELD, etc.).
Definitions
In this section you can declare the class variables.
BEGIN_DEFINITIONS
TYPE
CLASSES_REG : Class
PUBLIC
VARALPHA25 : ALPHA 25
VARALPHA50 : ALPHA 50
VARALPHA100 : ALPHA 100
VARSTRING : STRING
VARREALSTRING : REALSTRING
VARINTEGER : INTEGER
VARBOOLEAN : BOOLEAN
VARNUMERIC : NUMERIC 12
VARFINFANCIAL : FINANCIAL 18.2
VARSIGNED : SIGNED
10.4
VARLISTALPHA8 : LIST (ALPHA 8)
VARLISTCLASS : LIST (CLASSNAME)
End_Class
END_DEFINITIONS
The definition section begins with the keyword "BEGIN_DEFINITIONS" and ends with the keyword "END_DEFINITIONS". Between these keywords, Classes are defined below the keyword "TYPE".
Next the class name needs to be defined as a class, this name has to be the same name as the Class definition name
that you have entered while creating this class definition, and has to be at least 3 characters long.
Followed by the access modifier, currently "PUBLIC" and "PRIVATE" are implemented.
After these pre-filled items you can define your variables.
Allowed are the following LION types:
- Alpha
- Boolean
- Classes *
- Financial
- Integer
- List
- Numeric
- Realstring
- Signed
- String
- Structures #
Below your variables the class definition is closed by the End_Class keyword and the before mentioned "END_DEFINITIONS" keyword.
* As of AMT-14 it is possible to use nested classes, for more information regarding nested classes please read the section "Nested Classes" on the "Usage of Classes" page.
# While structures in classes are supported from AMT 78 on wards to ease migration projects, it is recommended to use nested classes (see above) instead of structures in classes. Structures in classes can not be used in calls from or to web services. In addition, when using the <Class>.ToJson or <Class>.ToXml functions on a class which contains a structure, the items in the structure will be serialized to a JSON string or XML string respectively but the structure itself will not.
Routines
The routine section contains all routines belonging to the class. Each routine contains a specific piece of code. In an object a routine is called if the specific code within that routine has to be executed. The code of a class routine always starts with BEGIN_ROUTINE and ends with END_ROUTINE. However, if the command "EXIT" is encountered while executing the code of a routine, that routine is quit immediately. See Class ROUTINE.