Insert and delete Commas
kray at sonsothunder.com
Sun Sep 29 02:26:01 EDT 2002
> Ken, please excuse my delay in thanking you for your input.
No problem. :-)
> Reading the applicable docs has not enabled me figure out how to
> implement Regular Expressions. It will be appreciated if you would
> give an example of how to implement
> ([-]?) etc. I assume a script is required. If so, what would the
> script be and where would it be located?
These were attempts at explaining the full regular expression use of the
matchText function, in the post, which was:
function insertCommas pNumber
if it is true then -- should be, but can't hurt to check
put "" into returnVal
if tDecimalHold <> "" then put "." before tDecimalHold
repeat with x = length(tMainNum) down to 1
if ((length(tMainNum) - x) mod 3 = 0) and (x <>
length(tMainNum)) then \
put "," before returnVal
put char x of tMainNum before returnVal
return tMinusHold & tMainNum & tDecimalHold
The code above is an example of the regular expression:
which I described in the previous post.
I don't know what you mean by "I assume a script is required. If so, what
would the script be and where would it be located?"... can you elaborate?
Sons of Thunder Software
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/
More information about the Use-livecode