version 6.0
DR Get refnum (area; scope) Longint
| Parameter | Type | Description | |
| area | Longint | 4D Draw area | |
| scope | Longint | -1=All | |
| 0=Selected | |||
| >0=Object ID | |||
| Function result | Longint | Reference number for the objects in area |
Description
The command DR Get refnum returns the reference number for the objects in 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 procedurally.
If scope equals -2, the function returns the default reference number.
If scope equals -1, the function returns the reference number for all objects in the document. If the reference numbers for the objects are not equal, DR Get refnum returns -32000, and DR Error returns error number 29.
If scope equals 0, the function returns the reference number for the selected objects. If the reference numbers for the objects are not equal, DR Get refnum returns -32000, and DR Error returns error number 29.
If scope is greater than 0, it must be equal to a specific object's ID; the function returns that object's reference number. If the object does not exist, DR Get refnum returns -32000, and DR Error returns error number 2.
Example
The following example is the object method for a button on a form that contains area. When the object 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.
If (DR Count (Area;0) = 1)
QUERY ([Parts];[Parts]Refnum = DR Get refnum (Area;0))
ALERT ("This object is a " + [Parts]Description)
End if
See Also