Lingo Dictionary > S > setProp |  |

setProp

Syntax

    setProp list, property, newValue
    list.listProperty = newValue
    list[listProperty] = newValue

Description

Command; replaces the value assigned to`property` with the value specified by `newValue` in the list specified by `list`. If the list doesn't contain the specified property, `setProp` returns a script error.

The `setProp` command works with property lists only. Using `setProp` with a linear list produces a script error.

This command is similar to the `setaProp` command, except that `setProp` returns an error when the property is not already in the list.

Example

This statement changes the value assigned to the age property of property list x to 11:

    setProp x, #age, 11

Example

Using the dot operator, you can alter the property value of a property already in a list, exactly as above:

    x.age = 11

See also

`setaProp`