Name: customPropertySet

Type: property

Syntax: set the customPropertySet of object to {setName | empty}

Summary: Specifies a set of custom properties applied to an object.

Associations: stack,field,button,graphic,scrollbar,player,image

Introduced: 1.0

OS: mac,windows,linux,ios,android

Platforms: desktop,server,web,mobile

Example:
set the customPropertySet of me to "Mac Properties"

Value:
The <customPropertySet> of an object is the name of the active property set.
By default, the <customPropertySet> of an object is empty.

Description:
Use the <customPropertySet> property to create and switch between sets of custom properties and property values.

An object can have multiple sets of custom properties. Each set is independent of the others, and the same property can have different values in different sets. To make a set's custom properties accessible, set the object's <customPropertySet> property to the name of the set you want to use. The values and properties in the current <customPropertySet> are used when you refer to a custom property.

If the setName is not already a custom property set, setting the <customPropertySet> to the setName creates a custom property set named setName for the object.

To use the default set of custom properties, set the <customPropertySet> to empty.

You can access a property that is not part of the current <customPropertySet> using array notation. For example, the following statement gets the value of a custom property named "foo" in a custom property set named "myCustomSet":

 get the myCustomSet["foo"] of field "Example"

If using arbitrary custom property names, be aware that it won't be possible to access them by changing the <customPropertySet> if they clash with LiveCode language keywords. Instead, either use the array style notation above, or use a prefix to prevent name clashes (for example "uName" instead of "name").

References: set (command), customPropertySets (property)

Tags: properties
