FieldFormatter: Working group admin at
Thu Oct 3 08:07:10 EDT 2013

A new field formatting palette and frontscript library is nearing
completion. The properties palette, syntax and integration are all in place
and working.

- What is its purpose?
In short it separates data from display. Field contents can, for example, be
displayed as currency (or any other arbitrary unit of measure), percentage,
dateTime, time duration or 'privatised', with numeric fields additionally
owning their own numberFormat, negative color, and thousands separator. The
underlying 'text' (or data) is unchanged; as soon as the field loses focus
or as soon as we programmatically change any of the properties, the field
contents change to reflect the new property settings.

- How do we use it?
Either using the properties palette or by script, we can
'set the percentage of fld n to true' : so 0.2 can be displayed as 20%
'set the numeric of fld n to true/false' : so only numbers can be entered
'set the displayChars of fld n to "$" : so 10 can be displayed as $10
'set the numericFormat of fld n to 0.00' : so 10 can be displayed as $10.00
'set the showThousands of fld n to true' : so 1250 can be displayed as
'set the privateChars of fld n to "......"' : so pa55w0rd can be displayed
as privatised text
'set the defaultText of fld n to "Enter a date here..."' : so empty fields
can display gray text help
'set the dhms of fld n to true' : so 70.38 can be displayed as 01 : 10.4
'set the isUSformat of fld n to false' : so 3/6/13 can be displayed as 3
June 2013
'set the dateTimeFormat of fld n to "yyyy-MMM-dd"' : so 3/6/13 can be
displayed as 2013-Jun-03
[.../...] etc
'put the rawtext of fld n into tQty' : so we can get the data rather than
the field contents
'set the rawtext of fld "total" to tQty * tCost' : so we can manipulate the
data and retain formatted displays.
[.../...] etc.

It should all 'just happen' intuitively.

It works with both the LC and MC IDE development environments, so clicking
twice on a field will show the new palette along with the existing IDE

- What is needed?
A small group of (preferably seasoned) developers to
[1] review the palette UI
[2] check integration and functionality
[3] critique and make suggestions, especially about the property names and
further functionality
[4] discuss, propose and share with a cc to others involved
[5] thrash the cr*p out of it :)

If interested, please let me know off-list. I agree with Richard G and am
hoping this concept will become mainstream, but it has to 'go with the flow'
and be a seamless extension to the existing 'feel' of LiveCode. Longer term,
I'd like it or something similar to be available at engine level, but this
is something we can all use now.

Best regards,

Hugh Senior

More information about the Use-livecode mailing list