Product Documentation

FairCom ISAM for C

Previous Topic

Next Topic

AddAutoSysTimeFields

Define which of the fields are automatically set by the server using the current server system time (in GMT time zone).

Type

ISAM Function

Declaration

NINT AddAutoSysTimeFields(FILNO datno, pA_STFIELDS defs)

Description

  • datno - the data file number. In V12, the file number typedef was formally changed from COUNT, a two-byte value to FILNO, a four-byte value. Refer to this link for compatibility details. Four Byte File Numbering TypeDef Change
  • defs - pointer to fields definition structure:

typedef struct astfields {

COUNT version; /* Version of this structure */

COUNT entries; /* number of entries in fields array */

LONG pad; /* padding to ensure struct alignment */

pA_STFIELD fields; /* fields array */

} A_STFIELDS, *pA_STFIELDS;

  • version - the version of the structure. must be set to A_STFIELDS_VERS_V01.
  • entries - the number of fields that needs to be automatically set with the system time. It must match the number of entries in the fields array.
  • fields - pointer to an array of field settings:

typedef struct astfield {

LONG fieldno; /* field number */

TEXT mode; /* set time */

} A_STFIELD, *pA_STFIELD;

  • fieldno - the field number in the DODA for the field that is set to auto setting with system time stamp.
  • mode - in which condition the field gets populated. Possible values:

    CT_AUTOSYSTIME_CREATE 0x01 - when the record gets added

    CT_AUTOSYSTIME_UPDATE 0x02 - when the record gets rewritten/updated.

Return

NO_ERROR on success

TOCIndex