remove empty lines

Alex Tweedly alex at tweedly.net
Wed Aug 2 18:18:49 EDT 2006


Liam Lambert wrote:

> Hi all
> how do I delete blank lines from a field
> I have something like this
>
>  put fld "emailList" into tEmailList
>   repeat for each line tEmail in tEmailList
>     if line tEmail is " " then (what would go here)
>     end if
>   end repeat
>
> or am I totally off the mark

You're close - you could do it like

> put fld 'emailList' into tEmailList
> put empty into tNewEmail
> repeat for each line tEmail in tEmailList
>    if line tEmail is not empty then
>       put tEmail & CR after tNewEmailList
>   end if
> end repeat
> put tNewEmailList into fld 'emailList'


but easier would be

> put fld 'emailList' into tEmailList
> filter tEmailList without empty
> put tEmailList into fld 'emailList'








-- 
Alex Tweedly       http://www.tweedly.net



-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.10.5/405 - Release Date: 01/08/2006




More information about the use-livecode mailing list