Lingo Dictionary > S > setaProp |
![]() ![]() ![]() |
setaProp
Syntax
setaProp list,
listProperty
,
newValue
setaProp
(
childObject
,
listProperty
,
newValue
)
list.listProperty
=newValue
list[listProperty
] =newValue
childObject.
listProperty
=
newValue
Description
Command; replaces the value assigned to listProperty
with the value specified by newValue
. The setaProp
command works with property lists and child objects. Using setaProp
with a linear list produces a script error.
![]() |
For property lists, |
![]() |
For child objects, |
![]() |
The |
Example
These statements create a property list and then adds the item #c:10
to the list:
newList = [#a:1, #b:5] put newList -- [#a:1, #b:5] setaProp newList, #c, 10 put newList
Example
Using the dot operator, you can alter the property value of a property already in a list without using setaProp
:
newList = [#a:1, #b:5] put newList -- [#a:1, #b:5] newList.b = 99 put newList -- [#a:1, #b:99]
Note: To use the dot operator to manipulate a property, the property must already exist in the list, child object, or behavior.
See also
ancestor
, property
, . (dot operator)
![]() ![]() ![]() |