question about find and replace

Ken Ray kray at sonsothunder.com
Tue Sep 30 13:56:58 EDT 2008


>   answer format("%03s",1)
> 
> will display 001 (the 3 means pad with zeros to 3 places).  So if the
> decimal points in your number series are intentional, you could make a
> function like:
> 
>  function padNumbers pSeries
>     repeat for each line tNum in pSeries
>       put "." & format("%03s",char 2 to -2 of tNum) & "." & cr after newSet
>     end repeat
>    return newSet
>  end padNumbers

Actually, you can put the periods into the format function:

  put format(".%03s.",1)
  --> .001.

Ken Ray
Sons of Thunder Software, Inc.
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/





More information about the use-livecode mailing list