Fandom

Livecode Wiki

Getprop

2,161pages on
this wiki
Add New Page
Comments0 Share

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.

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.