functions

fhSetValueAsLink

Description

Sets the value of an item to a record link.  Is primarily used with data items that are links, but from version 6.0.3 onwards it can also be used with place fields, to link a place field to a Place record (see Special Issues with Place Fields for more details).  If you wish to use fhSetValueAsLink to set the value of a Place field, you must use fhInitialise to ensure that the version is 6.0.3 or later.

Syntax

bOK = fhSetValueAsLink(ptr, ptrLink)

Parameters

ptr
item pointer: Item to receive link
ptrLink
item pointer: item pointer containing the record to link. This should be pointing to a record.

Returns

bOK
boolean: returns true on success and false on failure

Example

Taken from the Create Family Sample.

ptrFam = fhCreateItem("FAM")                        -- now create the family record
ptrLink = fhCreateItem("HUSB", ptrFam )             -- create a HUSB field in the family record
fhSetValueAsLink(ptrLink, ptrDad)                   -- and link dad into it