Mode Argument

Each Read/Write/Lock database function call format requires specification of a mode. The mode determines how GT.M interprets the key arguments (key1, key2...key-n).

The GT.M database function invoked has read-only access to the value represented by the mode argument. The mode argument must contain the actual value, not an address of the value, for passage to the GT.M database function.

The following keywords establish modes for data access operations.

The following keywords establish modes for data access operations. They are defined in gtmidef.h.

The following keywords establish modes for LOCK and ZALLOCATE operations.

The preceding keywords are described in subsequent sections. These keywords are defined in the module GTMI$DEF in the object library GTM$DIST:GTMLIB.OLB. Any program that has DAL calls using the above keywords need to be linked with the GTM$DIST:GTMLIB.OLB library. Note that in GTMI$_GLOBAL or GTMI$_EXTGBL modes the name in key1 and key2 respectively must not include the "^" character.

The keywords are described in subsequent sections. Notice that in GTMI_GLOBAL or GTMI_EXTGBL modes the name in key1 and key2 respectively must not include the "^" character.

Like all of the descriptor macros, the DESC_MODE macro must use the address of its second argument, so that argument cannot be a constant. (This restriction applies to all of the fixed-length data types.) Therefore, to establish a mode element so it has an address, it is necessary to store the value in a variable, as illustrated in the following example.

Example:

	gtm_descriptor k0[10];
	short mode;
	.
	.
	.
	mode=GTMI_GLOBAL;
	DESC_MODE(k0[0],mode);
	.
	.