functions

fhGetValueAsInteger

Description

Returns an integer as the value of a pointer.  Returns nil if the content of the point is not an integer.

Syntax

iValue = fhGetValueAsInteger(ptr)

Parameters

ptr
item pointer

Returns

iValue
Value of pointer as integer, if pointer does not contain an integer nil is returned.

Example

ptrf = fhNewItemPtr()
ptrf:MoveToFirstRecord('FAM')
ptrCount = fhGetItemPtr(ptrf,'~.NCHI') 
if ptrCount:IsNull() then
iChildCount = 0
else
    iChildCount = fhGetValueAsInteger(ptrCount) 
end
fhMessageBox(fhGetDisplayText(ptrf)..' had '..iChildCount..' children')