Error getting tags :
error 404Error getting tags :
error 404 ID | revDocs | RunRev
Welcome Guest (Log in)
Product Edition
Expander triangle
set the ID of {image | stack} to number get the [long | abbr[ev[iated]] | short] ID of object
Desktop, Web and Server
Platform Support
MacOS,Mac OS X,Windows,Linux
None required
Reports the unique ID number assigned to an object.

send mouseUp to button ID 2214
set the ID of image "Custom Cursor" to 2314
put the long ID of this card into savedID

Additional Comments
Expander triangle

Use an object's ID property to refer to the object in an unambiguous way.


The ID of an object is a non-negative integer.


A stack's ID is equal to the ID that will be assigned to the next object created within that stack, so the stack ID is subject to change. You can set the ID of a stack, but only to a greater number than its current ID.

You can set the ID of an image. Be careful not to set an image ID to a number that's the ID of another object in the same stack: since Revolution uses IDs to keep track of objects, a conflict may prevent Revolution from being able to access one or both objects. The following ID numbers are reserved and should not be used for image IDs:

* 1-100: reserved for built-in cursors

* 101-135: reserved for built-in brush shapes

* 236-300: reserved for built-in patterns

* 301-1000: reserved for built-in icons

* 101,000-103,000: reserved

* 200,000-299,999: reserved for application use

For all other objects, the ID property is assigned when the object is created and never changes. This means that for all objects except stacks and images, the ID property is guaranteed to be persistent. An object's name or number may change, but its ID does not.

For all objects, the ID is guaranteed to be unique within a stack. IDs are not reused if the object is deleted.

Note: An object that is created by copying and pasting, or with the copycommand, is assigned a new ID. If you cut an object and paste it into the same stack, it retains its original ID.

The short ID of an object is its ID number. If you don't specify a modifier for the ID property, you get the short ID form.

The abbreviated ID of an object is the object's type, followed by "id", followed by the object's short ID. For example, if a button's short ID is "27", its abbreviated ID is "button id 27".

The long id of an object includes information about its owner (and about the owner of that object, and so forth). For example, suppose a stack named "My Stack" contains a card whose ID is 11. This card has a group whose ID is 28, which in turn contains a button whose ID is 34. The card also has a card field whose ID is 46. If "My Stack" is a main stack and it's in a file whose path is "/Drive/Folder/Stack.rev", the long IDs of these objects look like this:

* The stack: stack "/Drive/Folder/Stack.rev"

* The group: group id 2238 of card ID 1001 of stack "/Drive/Folder/Stack.rev"

* The card: card id 1001 of stack "/Drive/Folder/Stack.rev"

* The grouped button: button id 34 of group id 2238 of card id 1001 of stack "/Drive/Folder/Stack.rev"

* The card field: field id 46 of card id 1001 of stack "/Drive/Folder/Stack.rev"

If the stack is a substack, its ID is included in the long name of each of its objects, before the path of the main stack.

The long ID of a group includes the ID of the current card. If the group does not appear on the current card, requesting its ID causes an execution error. If you need to get the ID of a group, use the "background" terminology instead.

The long ID of a background includes the ID of the current card, if the background appears on the current card. If not, the long ID of the background includes the ID of the first card the background appears on.

If an object's name is empty, getting its name yields its ID property instead.

Important! If a stack was originally created with HyperCard and then imported into Revolution, the ID of each control in the stack is guaranteed unique only within its domain. (You can check a stack'sHCStackproperty to determine whether it began life in HyperCard.)

Note: If a stack'sHCAddressingproperty is set to true, the long or abbreviatedID of a control in that stack begins with the word "background" if the control is part of a group, and with the word "card" if not.

User Comments
Expander triangle