Custom properties
When you edit and save the script of an object, the script of the object is immediately modified. This is very powerful and allows real-time programming.
However, when you save the script, the properties that you may have declared and that the script has already possibly changed are reset to the values defined in the declaration.
property the_folder:""
The current values of the script's properties are lost. You should have this behavior in mind when you script. Define as seldom as possible properties at the global level in an object's script. Rather, have your handlers pass one to the other the relevant parameters.
Referring to the script's owner
In the script of an object, the container property is defined by default: it refers to the owner of the script. For example the handler below, installed in the script of a dialog, will display the dialog's name when the user clicks any widget in the dialog.
on click in the_dialog item number the_index
dd (name of container as string)
end click in
|