Getprop message are activated when a custom property is requested, you will not obtain the value of the custom property, but the value after return. A getprop must be defined outside any message. Example:

getProp myCustomProperty
 return 23
end myCustomProperty

on MouseUp
 set the myCustomProperty of me to 11
 answer the myCustomProperty of me #23  will appear
end MouseUp

Notice that getprop usually don't change the value of the custom property.

Getprop is very useful when you need to create a dinamyc complex property of an object. For example in a button script you can write:

getprop lenghtofstring
put the length of the text of field "myfield" into temp
return temp
end lenghtofstring

on MouseUp
answer the lenghtofstring of me
end MouseUp

Notice that you can use even not existent custom properties, just the syntax must adhere to the custom properties syntax.

Community content is available under CC-BY-SA unless otherwise noted.