Repeat until (0r "while") not working
Jon
jbondy at sover.net
Wed Aug 10 07:58:50 EDT 2005
Ken and Chipp are being very helpful when they provide useful/working code, but I'm more curious about why the original code did not work. It looked reasonable to me: the kind of code I might actually use some day, and get stuck on.
Any thoughts?
:)
Jon
On 8/9/05 8:17 PM, "Sivakatirswami" <katir at hindu.org> wrote:
>I'm missing something very simple here,
>
>Goal: delete empty lines beginning and end of text chunk
>
>
Chipp Walters wrote:
> Katir,
>
> If you wanted to do it in a repeat loop:
>
> repeat with x = the number of lines in tFinalTranscript down to 1
> if line x of tFinalTranscript is "" then delete line x of
tFinalTranscript
> end repeat
Ken Ray wrote:
> Try this:
>
>function trim pWhat
> local tRetVal
> get matchText(pWhat, "(?s)^\s*(.*?)\s*$", tRetVal)
> return tRetVal
>end trim
>
>
>Trims all forms of whitespace (CRs, spaces, tabs, etc.) from the beginning
>and end of a text chunk.
>
More information about the use-livecode
mailing list