version 1
CT Get refnum (area; scope) Longint
| Parameter | Type | Description | |
| area | Longint | 4D Chart area | |
| scope | Longint | Scope of the function | |
| -2 = Default | |||
| -1 = All | |||
| 0 = Selected objects | |||
| >0 = Object ID | |||
| Function result | Longint | Reference number for the objects in area |
Description
CT Get refnum returns the reference number for the object(s) in the area described by scope. A reference number is a long integer associated with an object and is not necessarily unique. Reference numbers can only be manipulated programmatically. You assign a reference number to an object. The object ID, on the other hand, is assigned by 4D Chart.
If scope equals -2, CT Get refnum returns the default reference number.
If scope equals -1, CT Get refnum returns the reference number for all objects in the document. If the reference numbers for the objects are not equal, CT Get refnum returns -32000.
If scope equals 0, CT Get refnum returns the reference number for the selected objects. If the reference numbers for the objects are not equal, CT Get refnum returns -32000.
If scope is greater than 0, it must be equal to a specific object's ID and that object's reference number is returned. If the object does not exist, CT Get refnum returns -32000.
Example
This example is the object method for a button on a form that contains Area. When the method executes, it checks to see if only one object is selected, searches in the [Parts] table for the corresponding record, and displays its description
QUERY ([Parts];[Parts]Refnum = CT Get refnum (Area;0))
ALERT ("This object is a " + [Parts]Description)
See Also