Product Documentation

FairCom ISAM for C

Previous Topic

Next Topic

ctGETHGH

Retrieve the high-order 4 bytes of an 8-byte value.

Short Name

ctGETHGH()

Type

Low-Level function

Declaration

LONG ctGETHGH()

Description

Call ctGETHGH() after a routine that returns or sets an output parameter to a record address or other 8-byte address to get the high-word portion of the address.

To minimize the effect on performance in client/Server environments, ctGETHGH() does not make a separate call to the FairCom Server. Instead, the information needed by ctGETHGH() is cached on the client side.

Return

ctGETHGH() returns the high word portion of the address.

See FairCom DB Error Codes for a complete listing of valid FairCom DB error values.

Example

/* Assumes a key length of 14 (8 bytes for HUGE duplicate support), */


LONG recadr_hw,recadr_lw;

TEXT keybuf[14];


/* return lower order 4 bytes of record address */

recadr_lw = FirstKey(

9, /* index file number */

keybuf /* output key buffer */

);


/* return higher order 4 bytes of record address */

recadr_hw = ctGETHGH();

Limitations

ctGETHGH() clears the internal high-word variable when used. In most cases, this is not an issue, but if used for debug purposes, follow-up with ctSETHGH() to reset the value if it is required by a following function.

The recbyt parameter in this function is a 4-byte value capable of addressing at most 4 gigabytes. If your application supports HUGE files (greater than 4 gigabytes), you must use the ctSETHGH() and ctGETHGH() functions to set or get the high-order 4 bytes of the file offset. See also Record Offsets Under Huge File Support.

See also

ctSETHGH

TOCIndex