Constants

DefinitionCreation of constant codesAccess to constantsList of standard existing constants

1. Definition

Constants are variables that get code values when used by the supervisor and the engine layer to return error identification or a status. Some of these constants already exist in version 6, such as the values of ‘fstat’ while using database access instructions.

Version 7 implements the dictionary of constants, a new concept intended to provide explicit symbols instead of meaningless figures that are still in use.

Technically, the constants dictionary validation generates a list of global variables coded as [V]CST_xxx where xxx is the symbol that has been defined in the dictionary. The development partner can use these variables instead of existing values.

For example, codes [V]CST_AWARNING, [V]CST_AERROR, [V]CST_AOK used to describe a warning, an error, or an OK status that a function or a method may return, are easier to read than if the values were 1, 2 or 3.

Creation of constant codes

Creating constant codes is performed in the constants dictionary where the main information that must be entered are:

The coding rule for naming constants are defined in the naming document.

Access to constants

After the constants are defined and the validation is performed, the constants are available on the next connection as global values in the [V] class, with the syntax [V]CST_xxx.

List of standard existing constants

The following constants have been defined for the supervisor operations.

General contextName of the variableExplanation
Error codes used when calling operations or methods. Every error line that can be found in the AERROR class is present in the current context.AOKNo error encountered.
ASUCCESSThe operation was successful, an additional message that tells the success of the operation can be returned.
AINFONo error encountered, additional information messages returned.
AWARNINGWarnings are sent, but no errors are encountered.
AERRORSome errors are encountered, the function did not work as expected, error messages are returned.
AFATALFatal error encountered, the function did not work at all, with potential impacts on other operations.
Status code of a line within a Collection (ASTALIN property). Defines the status of a line during an update transaction managed by CRUD supervisor operations.ANEWA new line that has been inserted.
ADELA line in which a deletion has been requested.
ANEWDELA Line that has been inserted and in which a deletion has already been requested.
AUPD A line that has been updated.
ALLA line that has not been modified.
Position code of a line within a collection. Code can be used as a parameter for insertion or deletion of lines inside a grid.ALASTPOSPosition at the end of the grid.
AFIRSTPOSTPosition at the first line of the grid.
ANOTDEFINEDReturned message when a position in a grid is not found.
Return value from a database operation such as Read, Readlock, Write, Rewrite, RewriteByKey, Delete, DeleteByKey.
This return value can be found in fstat global variable.
AOK0: The database operation was successful.
ALOCK1: A locking error happenend on the current line.
AOUTSEARCH2: When read with >= or <= operator, a result was found but not with an equal value.
ADUPKEY3: The write or update operation failed because an attempt of creation of a duplicate key was done on an index on which no duplicate keys are allowed.
AOUTKEYS4: Attempt of reading a key value that is smaller or greater than all existing key values.
ANOREC5: Record not read (no current record exists).
ARECTICKUPD6: The line no longer exists with the right updtick value (concurrency error during an update operation).
ARECTICKDEL7: The line no longer exists with the right updtick value (concurrency error during a delete operation).
Logical valuesATRUE1 (corresponds to the result of a comparison that is true).
AFALSE0 (corresponds to the result of a comparison that is false).
AYES2 (corresponds to the Yes value in the local menu #1).
ANO1 (corresponds to the No value in the local menu #1)
Level of definition for parameters (corresponds to the value of the 'NIVDEF' column in parameter dictionary)ALEVCPY2 (the parameter is defined at company level).
ALEVFCY3 (the parameter is defined at site level).
ALEVFOLD1 (the parameter is defined at folder level).
ALEVLEG5 (the parameter is defined at legislation level).
ALEVUSR4 (the parameter is defined at user level).
Internal data types (corresponds to the values stored in local menu #30 for the 'ATYPTYP' column in data type dictionary, with the exception of the value '13' (ATYPINSTANCE) that is not defined in this local menu)ATYPBLOBBlbfile type (binary object).
ATYPCHARChar type (character string in UNICODE per default).
ATYPCLOBClbfile type (character long object).
ATYPDATEDate type.
ATYPDATETIMEDatetime type.
ATYPDECIMALDecimal type.
ATYPDOUBLEDouble type (floating point with double precision).
ATYPFLOATFloat type (floating point with simple precision).
ATYPINSTANCEInstance type (instance pointer).
ATYPINTEGERInteger type (long integer).
ATYPSHORTINTShortint type (short integer).
ATYPTINYINTTinyint type (tiny integer).
ATYPUUIDUUID type.