Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: length? pick problems

From: larry:ecotope at: 25-Nov-2000 16:31

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 <[Vache--bluejellybean--com]> To: <[rebol-list--rebol--com]> 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"]