Help home › The Family Historian API › Objects › Item Pointer › IsSame

Item Pointer

IsSame

Description

Compares this item pointer with another item pointer.  It returns true if the two pointers are pointing at the same item.

Syntax

bIsSame = ptr:IsSame(ptrComp)

Parameters

ptrComp
Item Pointer: Pointer to compare this to.

Return Value

bIsSame
boolean: True if ptrComp points at the same item as this item pointer.

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