Item Pointer

IsSame

Description

IsSame, allows a pointer to be compared to another item pointer, returns true if the items pointed to are the same.

Syntax

bIsSame = ptr:IsSame(ptrComp)

Parameters

ptrComp
Item Pointer: Pointer to compare this to.

Return Value

bIsSame
boolean: True if item pointer is the same as parameter.

Example

I am my own Grandpa!
-- My Own Grandpa?
ptrRoot = fhNewItemPtr()
ptrGranddadP = fhNewItemPtr()
ptrGranddadM = fhNewItemPtr()
tblRecordList = fhPromptUserForRecordSel('INDI', 1)
ptrRoot = tblRecordList[1]
ptrGranddadP = fhGetItemPtr(ptrRoot,'INDI.~FATH[1]>~FATH[1]>')
ptrGranddadM = fhGetItemPtr(ptrRoot,'INDI.~MOTH[1]>~FATH[1]>')
if ptrGranddadP:IsSame(ptrRoot) or ptrGranddadM:IsSame(ptrRoot) then
   fhMessageBox('I am my own Grandpa')
else
   fhMessageBox('I am not my own Grandpa')
end