custom prop

Jeanne A. E. DeVoto jeanne at runrev.com
Tue Jan 29 00:17:01 EST 2002


At 10:32 AM -0800 1/27/2002, yves COPPE wrote:
>When I click "custom" in the tab-window properties of an object,
>you have two fields :
>
>custom property sets
>or
>property set keys
>
>If I want to create one, in which window do I need to click the "New" button ?
>
>And more generally, what's the difference between the two kinds of
>custom properties ?
>
>I have read the chapter in the documentation but I don't understand the trick.

Hi Yves. Actually, for most purposes you can ignore the issue of custom
property sets. They are very useful at some times, but if you're just
getting started, pretend that the Custom Property Sets field on the left,
and its buttons, are not there. Use the field on the right to create your
custom properties and they will work fine.

When you become advanced ;-), you can use the Custom Property Sets to
create multiple sets of custom properties. Usually, you use these sets in
order to switch between values of a property - you can have a property with
the same name (but a different value) in two sets. When you "get" the
property, the value depends on which set is active.

For example, suppose you have a bunch of custom properties that hold
strings in French that are used in your application. Your scripts might use
these custom properties. For example, you might have a line like
  answer the myStringHere of this stack
which displays the contents of the custom property called "myStringHere" in
an answer dialog box. So far, you do not need custom property sets at all -
only custom properties.

Then you decide you want to translate your app into English. In this case,
you could place your original properties into a set called "frenchStrings",
then create another set called "englishStrings". Each set would have the
same-named properties, but one set would have them in French and the other
in English. Then you would switch between the sets depending on what
language the user wants, and the line
  answer the myStringHere of this stack
would provide either the English or French, depending on which custom
property set is active: "englishStrings" or "frenchStrings".

--
Jeanne A. E. DeVoto ~ jeanne at runrev.com
http://www.runrev.com/
Runtime Revolution Limited - Power to the Developer!





More information about the use-livecode mailing list