ID | |||||||
Type | property | ||||||
Dictionary | LCS | ||||||
Library | LiveCode Script | ||||||
Syntax |
| ||||||
Associations | stack, card, field, button, graphic, scrollbar, player, image, group | ||||||
Summary | Reports the unique ID number assigned to an object. | ||||||
Introduced | 1.0 | ||||||
OS | mac, windows, linux, ios, android | ||||||
Platforms | desktop, server, mobile | ||||||
Example |
| ||||||
Values |
| ||||||
Related | Keyword: abbreviated, file, button, long, integer Property: name, HCAddressing, owner, groupIDs, HCStack, altID, cardIDs Command: copy, group, libURLSetLogField, push Function: stacks, number Glossary: object, card control, file path, property, control, command, image, execution error, main stack, card, current card, background, HyperCard, domain Object: stack, image | ||||||
Description | Use an object's ID property to refer to the object in an unambiguous way. 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 LiveCode uses IDs to keep track of objects, a conflict may prevent LiveCode from being able to access one or both objects. The following ID numbers are reserved and should not be used for image IDs:
For all objects, the ID is guaranteed to be unique within a stack. IDs are not reused if the object is deleted.
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 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.
| ||||||
Tags | objects |