[REBOL]
From: hijim:pronet at: 21-Jul-2002 9:07
I'm trying to add up every 7th line (my-data: read/lines 02.exp) in an array. I get
errors messages when I try to use a variable to assign the line number I want to add
to the total.
I can print to-money pick my-data count
I can't total: to-money pick my-data count
It goes to the wrong line in the data, the first line.
button green "Calculate" [
for count 5 last-line rec-len [
if my-data/:count > to-string newline [
prin to-money my-data/:count
]
]
total: 0
for count 5 last-line rec-len [
if my-data/:count > to-string newline [
total add total pick to-money my-data count
]
]
]
The first loop works fine.
$2.63 $22.41 $15.54 $15.54 $86.76 $10.75 $22.41 $9.38 $192.87 $12.30 $12.94 $2.92 $13.78
$35.40 $2.24
The second gives me an error.
** Script Error: Invalid argument: 01/02
** Where: to-money
** Near: to money! :value
How do I get around this?
to-money my-data/:count
doesn't work either.
Thanks,
Jim