Script Limits

Richard Gaskin ambassador at fourthworld.com
Thu Aug 7 05:30:00 EDT 2003


jbv wrote:

> I remember in HC and OMO using scripts of controls to hold
> data. In case scripts of controls in MC are used for the same
> purpose (holding data, and not executable code), could custom
> props be a nice workaround ?

More than a workaround, there are many advantages:

- Custom properties can hold any data, even binary.

- You can have as many custom props as you like in any object.

- You can have any number of custom property sets in any object.
  For example you could store your user prefs in a stackfile that
  has a custom property set for each user, with each pref item
  stored as a property within that set, e.g.:

       ask "Please login:"
       put it into tUserName
       set the customPropertySet of stack "PrefsStack" to tUserName
       get the uSetupInfo of stack "PrefsStack"
       -- "it" now contains the value of the uSetupInfo of the
       -- property set which matches the login name, with each login
       -- name havings its own parallel set of props.

- You can use array notation for custom properties, useful for numeric
  indexing or stepping through a list of keys, e.g,:

       put the hilitedtext of fld "Users" into tUserList
       repeat for each line tUser in tUserList
          put the uUserStats[tUser] of btn "Data" &cr after tReport
       end repeat
       put tReport into fld "Login Report"


- It leaves the object's script free to contain code without
  having to worry about altering data.


Custom properties are a very powerful feature of not only Rev but other
xTalks as well, including ToolBook, Gain Momentum, and SuperCard.  Well
worth taking an evening to experiment with...

-- 
 Richard Gaskin 
 Fourth World Media Corporation
 Developer of WebMerge: Publish any database on any Web site
 ___________________________________________________________
 Ambassador at FourthWorld.com       http://www.FourthWorld.com
 Tel: 323-225-3717                       AIM: FourthWorldInc




More information about the metacard mailing list