Primarily for Package and Script authors, E-Prime provides the ability by the use of compiler Const flags to determine the version of the runtime to avoid syntax errors amongst version different situations. This permits the author of the script to implement one resource that can be used amongst all versions of E-Prime instead of needing to maintain and distribute multiple copies per each version instance.
In E-Prime 1.1 and beyond, specific Const entries are included automatically that code can be used to test against to determine what version of the runtime is being used.
The following entries are automatically defined...
RUNTIME_CONST_SUPPORTED = True
RUNTIME_VERSION_MAJOR = (integer)
RUNTIME_VERSION_MINOR = (integer)
RUNTIME_VERSION_INTERNAL = (integer)
RUNTIME_VERSION_BUILD = (integer)
RUNTIME_VERSION_PATCH = (string)
RUNTIME_VERSION_SERVICEPACK = (integer)
The above constants will reflect the current version of the runtime installed on the system.
An example of how one may use the pre-defined constants as follows:
#If RUNTIME_VERSION_MAJOR >= 1 Then
Dim x As Long
x = Display.SegmentCopyHeight
Debug.Print "Version 1.0 does not support the Display.SegmentCopyHeight property"
NOTE: In E-Prime 1.0, these version constants do not exist and result in values of zero (0) when compared.
This topic applies to: