Name: properties

Type: property

Syntax: set the properties of <object> to <propertiesArray>

Summary:
Specifies some of an <object|object's> <properties> and their current
<value|values>. 

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

Introduced: 1.0

OS: mac, windows, linux, ios, android

Platforms: desktop, server, mobile

Example:
put the properties of button 1 into myArray

Example:
set the properties of last player to the properties of player "Example"

Value:
The <properties> of an object is an array containing that object's
significant built-in properties.

Description:
Use the <properties> property to set an object's built-in properties, or
to copy properties from one object to another.

Not every property is included in the <properties> property. The
following types of properties are excluded:

* Read-only properties
* The script property and custom properties
* Synonyms: Only one synonym for each property is included.
* Duplicates: Properties that are functionally duplicated by other
  properties are not included. For example, the rectangle property is
  included, but not the height, width, top, bottom, left, right, or
  location properties, because you can derive all of them from the
  object's rectangle.
* Properties other than object properties: Global properties, local
  properties, properties of a character or chunk in a field, and
  adjectives such as short that are implemented internally as properties
  are all excluded.
* Others: Some other properties are excluded.


The key of each element in the array is the property name. Use the
following statements to obtain a list of the properties for a particular
object type:

The value of each element in the array is the value of that property for
> the object. For example, use this statement (after the above example)
> to get the object's ID property:
>*Note:* You can't use array notation with an expression, only with a
> variable, so you must put the <properties> of the object into a
> variable before you can access the individual elements of the array.
> If you want a list of properties and their values, use the
> combinecommand to create a list:

If you set the <properties> of an object to an array that contains only
some of the properties, any properties that aren't in that array are not
changed. This means that you can select which properties to set with the
<properties> property .

For example, suppose you want to set the <properties> of a field to the
<properties> of another field, except that you want to leave the first
field's name unchanged:

    put the properties of field "My Field" into myArray
    delete variable myArray[name] -- delete this element from the array
    set the properties of field "New Field" to myArray
    -- leaves name property unchanged


    put the properties of field "My Field" into myArray
    delete variable myArray[name] -- delete this element from the array
    set the properties of field "New Field" to myArray
    -- leaves name property unchanged


On storing the properties are set in the correct order to ensure correct
> recreation of the object.
>*Note:* When setting properties which contain both non-empty color and
> pattern properties of the same type, the color property will take
> precedence. 

Changes:
As of version 6.1 the <properties> property has been revised. On
fetching it returns the minimal set of properties of an object to allow
it to be recreated exactly, it also returns unicode variants of
properties if, and only if, they are needed.

References: setProp (control structure), keys (function),
propertyNames (function), value (glossary), object (glossary),
properties (property), customProperties (property)

Tags: properties

