DataBasic Elements
Statement Labels
Reality accepts the following:
-
A label can have one or more spaces between the label identifier and the terminating colon.
-
A label's terminating colon can be followed by a semicolon (see Multi-statement Line). This allows a comment to be included on the same line as the label.
-
A label can have the same name as a literal, symbol or variable.
Predefined Symbols
In MVENTERPRISE mode (set with the $OPTIONS statement), the following additional predefined symbols are available:
Symbol |
Value |
Description |
---|---|---|
@DAY |
DATE() 'DD' |
Current day of the week. |
@MONTH |
DATE() 'DM' |
Current month. |
@YEAR |
DATE() 'DY' |
Current year. |
Substring Extraction
Reality will accept an alternative syntax for substring extraction, whereby if the length parameter is omitted, a positive start# parameter is treated as shorthand for a negative start# parameter, combined with a length parameter with the same value. For example, the expression VAR[3] produces the same result as VAR[-3,3]; that is, it extracts the last three characters of VAR.
This is used on many other MultiValue systems.
Item Locks
DataBasic and Proc allow you to lock the same item multiple times (this will normally occur if the item is processed by a number of different programs or subroutines, each of which locks the item). On Reality, the item must be unlocked the same number of times, while some other MultiValue systems (for example, D3) require only a single release operation.
The following database configuration parameters allow a Reality database to be configured to work in a similar way to these MultiValue systems:
RosStyleItemLocks
Specifies that item locks should be held separately from any file variable; as a
result, closing a file will not release any item locks.
MvStyleItemLocksSpecifies that a single RELEASE operation will simultaneously release all the locks taken on a file item.
Note that, unless RosStyleItemLocks has been explicitly cleared, setting this parameter also sets RosStyleItemLocks.
Boolean Compiler Directives
These are compiler directives that allow conditional compilation of code in a way similar to the $IFDEF statement. They provide backwards compatibility with existing mvEnterprise code; for details, refer to the mvEnterprise documentation.
Syntax
IF [trueSymbol THEN || falseSymbol ELSE] statements
Syntax Elements
trueSymbol A symbol that has been defined as equal to either $TRUE or $T.
falseSymbol A symbol that has been defined as equal to either $FALSE or $F.
statements One or more DataBasic statements on a single line. Multiple statements can be separated by semicolons.
Comments
Symbols used in this way can be defined using the EQUATE or $DEFINE statements.