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

[REBOL] my-data

From: jim::clatfelter::net at: 21-Jul-2002 17:39

Hi Gregg, I'm just starting this script. I put the code I have so far at http://www.clatfelter.net/a-bookeep.r I put the January data at http://www.clatfelter.net/2002.exp The data are in lines like this: 7 fields, 1-Date, 2-Check# (if needed), 3-To, 4-For, and 3 fields (5, 6 and7) for expense categories. The last 3 are the ones I need totals for. That's why I was looping through the lines. I can loop through and print the contents of the field, but when I try to assign a value from the field (to total), it go to the wrong one. It goes to the date line (1) instead of the expense line (5) I am trying to total. It's the exact same code, but it goes to the wrong line on one and not on the other. I'm sure the loop is correct. This is the data order for the first two records: 01/02 Chevron Equip Gas 2.63 01/02 2488 Greenmark Fertilizer 22.41 button green "Calculate" [ for count 5 last-line rec-len if my-data/:count > to-string newline [ prin to-money my-data/:count prin " " ] ] 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 ] ] ] Do I need to add probe? total add total probe pick to-money my-data count That doesn't solve the error. ** Script Error: Invalid argument: 01/02 (that's the first date on line 1. It should be line 5) ** Where: to-money ** Near: to money! :value Thanks for any help, Jim