FairCom Corporation


F.41 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 c-tree Server. Instead, the information needed by ctGETHGH is cached on the client side.

RETURN

ctGETHGH returns the high word portion of the address. See Appendix A "c-tree Plus Error Codes" of the c-tree Plus Programmer's Reference Guide for a complete listing of valid c-tree Plus 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();

LIMITATION

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 requered 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

ctSETHGH


FairCom Corporation
www.faircom.com