EbsScript offers a lot of functions that are not part of the PASCAL language, but are specific add-ins for using EbsScript within Ebsilon. These functions can be called by just typing the function name, e.g.
simulate;
If the function requires arguments, they have to be enclosed in round brackets "( )", separated by commas (","): If the function returns a value, it can be used in an assignment operation of the correct type of variable, e.g.
string1 := getTime("%d.%m.%Y" );
where string1 is defined as STRING. "%d.%m.%Y" is an optional argument of the getTime function that specifies the format of the resulting time string (in this case, the date is displayed as 23.10.2001).
When you use the function tree in the EbsScript editor, the type of return value is indicated after the name of the function (e.g., getTime:STRING). The arguments will be visible when you insert the function in your code by double-clicking the function name in the tree. For instance, the EbsScript editor inserts
getTime( {format:STRING = "%H:%M:%S"} );
This notification indicates that getTime takes one argument called format, which is of type STRING. But this argument is optional, because there is a default value, indicated after the "=". Therefore, the calls
getTime("%H:%M:%S");
and
getTime;
are equivalent.
There are several groups of functions which are described in the following chapters. The tables consists of
For some tables, additional columns are included.
EbsScript Extensions
It is possible to extend the functionality of EbsScript, e.g. for usage in the EBSILON Performance Optimization System (E-POS). Some functions can be used within EBSILON®Professional as well. The available add-ins are listed in the overview of the functions with the comment "Special license required".
If you are interested in using these functions, please contact us.
Function Overloads
It is now possible to overload functions/procedures. These, however, must be marked by an appended “overload“ .
Overloaded functions/procedures by the same name must differ in pairs in the signature (in the number of the parameters or in at least one parameter type).
See EbsScript in the sample file “Data\Examples\ebsscript_function_overload.ebs“)
Classes
EbsScript now supports classes. As Pascal does not define a standard for classes, EbsScript classes are structured according to the syntax of Delphi. In contrast to Delphi,
however, class instances in EbsScript are automatic variables, i.e. class instances do not have to be destroyed explicitly but are automatically destroyed by the system when releasing the last reference (catchword: automatic reference counting aka. ARC).
Moreover, classes allow to overload operators (see sample file “Data\Examples\ebsscript_operator_overload.ebs”).
The EbsScript data constructor “Record” now also allows member functions/procedures and operators, but no inheritance or virtual methods.
The main difference between classes and records is that class instances are “reference types” (i.e. are allocated to the heap); whereas instances of records are “value types” (i.e. usually are allocated to the stack).