FDDereference, FDReference, and FDReferenceCount

Demonstrates how to determine reference count on a file.

Remarks

This example illustrates how to get the reference count of a file and then increase and decrease the reference count on the file.

Code

 local integer tfid, integer RefCount
 tfid = DBOpen( GetPCIHOME() + "/demo/irvine.pix", "r")
 RefCount = FDReferenceCount(tfid)
 Print "1. Count is ", RefCount
 Call FDReference(tfid)
 RefCount = FDReferenceCount(tfid)
 Print "2. Count is ", RefCount
 Call FDDereference(tfid)
 RefCount = FDReferenceCount(tfid)
 Print "3. Count is ", RefCount
 Call DBClose(tfid)

Output

1. Count is 1
2. Count is 2
3. Count is 1

© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.