Repeat until (0r "while") not working

Michael J. Lew michaell at unimelb.edu.au
Thu Aug 11 00:43:42 EDT 2005


Tried this in the message box: put the number of lines in ("This is a 
test" & CR)
=>1

The transcript does what it should. The confusion is that the CR is 
part of the line that it ends, not the second line whose existence it 
seems to imply.

At 11:03 PM -0500 10/8/05, Ken Ray wrote:
>Here's the
>stuff I found when I put (CR & CR & "This is a test" & CR & CR) into a field
>and then ran the original code:
>
>>  put fld "transcript" into tFinalTranscript
>>
>>  # clean up extra lines at beginning and end
>>
>>  repeat while ((line 1 of tFinalTranscript) is empty)
>>     delete line 1 of tFinalTranscript
>>  end repeat
>>
>>  repeat until ((the last line of tFinalTranscript) is not empty)
>>     delete the last line of  tFinalTranscript
>>  end repeat
>>
>>  put tFinalTranscript
>>  exit to top
>
>
>- It removed all the CRs from the beginning of the string
>- I removed the only one of the CRs from the end of the string
>
>Leaving me with:  "This is a test" & CR

-- 
Michael J. Lew

Senior Lecturer
Department of Pharmacology
The University of Melbourne
Parkville 3010
Victoria
Australia

Phone +613 8344 8304

**
New email address: michaell at unimelb.edu.au
**



More information about the use-livecode mailing list