Hi St�phane

Try this

>> foreach i t [if (length? i) <> 0 [print i]]
one
two

Rebol is smart, but not smart enough to figure out where to stop in that
case : if length? i <> 0

Salut

Patrick


----- Original Message -----
From: "Bansard Stephane" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, March 13, 2002 5:39 PM
Subject: [REBOL] getting rid of empty string in a block.


> Hi all,
>
> I want to sort a file by line alphabetic order. It appears it works at
once as I
> write an idea ! Rebol is great !
> str: copy []
> foreach l (sort read/lines %my-file) [append str join l "^/"]
>
> But I haven't thought of blank line which are empty string in the sort
> read/lines resulting block.
>
> I try using the string length. But I don't understand the following
evaluations
> :
>
> >> t: ["" "" "one" "two"]
> >> foreach i t [print length? i]
> 0
> 0
> 3
> 3
> >> foreach i t [if length? i [print i]]
>
>
> one
> two
> >> foreach i t [if length? i <> 0 [print i]]
> ** Script Error: length? expected series argument of type: series port
tuple
> struct
> ** Near: if length? i <> 0
>
> >> foreach i t [if (length? to-string i <> 0) [print i]]
>
>
> one
> two
>
> ----
>
> What would be the best solution to get rid of the empty strings ? (or of
any
> empty values of a block, be they string or of any type? Could you give me
a
> pointer to the explanation of this in the official doc ?
>
> Many thanks,
> Best regards
> Stephane
>
>
>
>
>
> --
> To unsubscribe from this list, please send an email to
> [EMAIL PROTECTED] with "unsubscribe" in the
> subject, without the quotes.
>

 
______________________________________________________________________________
ifrance.com, l'email gratuit le plus complet de l'Internet !
vos emails depuis un navigateur, en POP3, sur Minitel, sur le WAP...
http://www.ifrance.com/_reloc/email.emailif


-- 
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the 
subject, without the quotes.

Reply via email to