Hi Vache
Here is one short way to do what you want, by making use of a second block.
>> new-data: []
== []
>> foreach item table-data [if item <> "" [append new-data item]]
== ["CREAF" "Nasdaq-NM" "$" "14.3125" "0.4375" "3.15%" "28,800" "CSCO"
"Nasdaq-NM" "$
" "52.6875" "2.125" "4.2%" "21,082,300" "DELL"...
There are problems with using remove and other series mutators in loops
because it is changing the length of the series and the position of the
current index of the series while the loop is executing.
The test in the loop could also be written in other ways:
if (length? item) > 0
if not empty? item
HTH
-Larry
----- Original Message -----
From: Vache <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, November 25, 2000 3:21 PM
Subject: [REBOL] length? pick problems
> REBOL []
>
> table-data: ["CREAF" "" "" "" "Nasdaq-NM" "" "" "" "$" "14.3125" "" "" ""
"0.4375" "" "" "" "3.15%" "" "" "" "28,800" "CSCO" "" "" "" "Nasdaq-NM" ""
"" "" "$" "52.6875" "" "" "" "2.125" "" "" "" "4.2%" "" "" "" "21,082,300"
"DELL" "" "" "" "Nasdaq-NM" "" "" "" "$" "24.375" "" "" "" "1.375" "" "" ""
"5.98%" "" "" "" "10,594,700" "COMS" "" "" "" "Nasdaq-NM" "" "" "" "$"
"14.125" "" "" "" "0.125" "" "" "" "0.89%" "" "" "" "1,784,500" "SUNW" "" ""
"" "Nasdaq-NM" "" "" "" "$" "84.875" "" "" "" "4.875" "" "" "" "6.09%" "" ""
"" "10,086,900"]
>
> x: length? table-data
> count: 1
>
> repeat count x [if length? pick table-data count = 0 [remove table-data
count]]
>
>
> print table-data
>
> halt
>
> ---
>
> The goal is to loop through the block, and remove all the "" (emptey)
values. However, I get an error on (length? pick table-data)
>
> Any ideas? Thanks in advanced fellow rebolers :]
>
> Vache
>
> _____________________________________________________________
> Get free email ==> and Free Fun http://www.BlueJellybean.com
> --
> To unsubscribe from this list, please send an email to
> [EMAIL PROTECTED] with "unsubscribe" in the
> subject, without the quotes.
--
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the
subject, without the quotes.