DR Get refnum

4D - Documentation   Français   English   German   4D Draw 2004, Command Theme List   4D Draw 2004, Command Alphabetical List   Back   Previous   Next

version 6.0


DR Get refnum (area; scope) Longint

ParameterTypeDescription
areaLongint4D Draw area
scopeLongint-1=All
0=Selected
>0=Object ID
Function resultLongintReference 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

DR Get ID, DR SET REFNUM.


4D - Documentation   Français   English   German   4D Draw 2004, Command Theme List   4D Draw 2004, Command Alphabetical List   Back   Previous   Next