DataBasic Elements

Statement Labels

Reality accepts the following:

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.

Pattern Matching

In MVENTERPRISE mode (set with the $OPTIONS statement), multiple patterns used with the MATCH(ES) operator can be separated by any of the Reality system delimiters – attribute mark (@AM), value mark (@VM) or subvalue mark (@SM or @SVM).

Strings as Logical Expressions

In Reality mode, if a non-numeric string is used as a logical (Boolean) expression, a run-time error is generated and the result is false (see Logical Expressions). In MVENTERPRISE mode (set with the $OPTIONS statement), a non-numeric string evaluates to true and no error is generated.

Format Strings

Example

PRECISION 4

A = 1234.56789

PRINT A "3"
PRINT A "32"
PRINT A "35"

If this program is run in Reality mode and other MultiValue modes, the results are as follows:

Reality mode MVENTERPRISE mode Other MultiValue mode
1234.568
12.346
0.012
1234.568
1234.568
123.457
1234.568
123456.789
123.457

Item Locks

DataBasic and Proc allow you to take multiple locks on the same item (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, each of these locks must be separately released, while some other MultiValue systems (for example, Power 95) require only a single release operation.

If required, a Reality database can be configured to work in a similar way to these MultiValue systems by setting the database configuration parameter MvStyleItemLocks to 1.

User Exits

In all MultiValue modes (selected with the $OPTIONS statement), if a user exit is called with the ICONV or OCONV function, a runtime error occurs and 0 is returned.

Go to top button