Trying a custom handler for several math fields
J. Landman Gay
jacque at hyperactivesw.com
Sat Sep 14 14:10:24 EDT 2013
On 9/14/13 11:55 AM, Vaughn Clement wrote:
> Hi Richard
>
> Frankly I was surprised that LC did not recognize commas and money symbols.
> This is a standard thing in almost any software that has numbers being
> used? I would think it could be added to the object inspector to set the
> money settings, and maybe still treat the field as a string for purposes of
> calculations.
You're used to end-user products, where the work is done under the hood
for you. Now you're using a general programming language, where you're
the one writing the code under the hood.
LiveCode is used for many different types of apps, and number crunching
is just one small part of its capabilities. Just as you would prefer
that LiveCode manage a particular type of string in one way, someone
else's code would break if LiveCode took that sort of liberty with their
literal string entries. The engine can't presume that a dollar sign (or
a euro or yen or whatever) should be treated in only one way. In fact,
the dollar sign specifies a global system variable; the engine can't
know that you want it to mean money and not one of those.
Interfering with commas in numbers would be a disaster. Comma is the
default delimiter in lists, and almost everyone's code would instantly
break if that were changed. The engine can't know that your commas are
just visual indicators and mine separate a list of numbers that I intend
to process as separate items. As the programmer, you manage all that.
We aren't in end-user land any more. :)
--
Jacqueline Landman Gay | jacque at hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
More information about the use-livecode
mailing list