[REBOL] Re: (No subject)Date: Mon, 22 Jul 2002 04:23:39 +1000
From: anton::lexicon::net at: 21-Jul-2002 11:15
I think you are picking a value after it has been
converted to money!
Or the value "01/02" is really in your data.
Add some probes to find out what value you are
really getting at each point.
'probe is really useful, see in the code below.
> 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 [
if error? set/any 'err try [ ; catch errors
> total add total pick to-money my-data count
;^^^ I assume you really mean:
total: add total to-money probe pick my-data count
][
err: disarm err
; do something about errors here.
]
> ]
> ]
> ]
>
> 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
Anton.