FANDOM


Every object by default contains no custom properties, but you can add them to an object to store values.

You can add or change a property using the property inspector window or through script code.

A custom property has the same behavior as regular properties, to create one just use set:

set the mycustprop of me to "Hello world"

Custom properties are fundamental in LiveCode, and can change the way programmers code. The idea of linking the data with the object using it is productive.

If you don't need the custom property for an object anymore, you can delete it and also all of the objects other custom properties. This way the software doesn't continue to store unnecessary data. It allows it to be clear where the data is, and why.

For example you can pass data:

on Mymessage1
  put the pCounter of me into temp
  add 1 to temp
  set the pCounter of me to temp
end Mymessage1

On MouseUp
   put the pCounter of me into temp
   answer ("Now the counter is " & temp)
end MouseUp

More oevr you can use them in conjunction with Setprop and Getprop.

You can see and edit custom properties visually with the property inspector: as well:

CustomProperties

Custom property editor, in the custom property page

CustomProperty2

New custom property window, form version 8

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