Insert and delete Commas
dsc at swcp.com
Wed Sep 18 10:01:01 EDT 2002
On Wednesday, September 18, 2002, at 07:24 AM, Robert Presender wrote:
> The following custom handlers(?) are used in an application
> developed in SuperCard.
> They are used for math processes such as addition, subtraction,
> etc.. They work in Rev.
> Would appreciate any comments relating to shorting or modifying
> the scripts or a different approach. The scripts are to be used
> on Mac and Windows platforms.
I'm making a wild guess as to the requirements here. Based on that
I advise that you adopt a style using functions. Create a function
to insert commas and one to remove them. The functions would take
a value and return a value. They would not touch any data outside
the function, especially fields. Processing data in fields is
slower than processing data in variables.
Use those two functions to create your handlers for processing a
range of fields or, since they are general, in lots of other ways.
I'm not sure what these are intended to do. Are these supposed to
take a value like "-1234567890" and change it to "-1,234,567,890"
and the inverse?
(If so, removing might be done with a replace command.)
More information about the Use-livecode