1. RE: EDS help
- Posted by "C. K. Lester" <cklester at yahoo.com> Jun 19, 2003
- 406 views
Kent Vogt wrote: > --select table > if db_select_table("all") != DB_OK then > puts(2, "Couldn't find table!\n") > abort(1) > end if > > --start loop of rewriting data--currently not a loop > --trying to get it to work for the first item > > item=db_record_data(1) At this point, you need to print out what item is, just to verify it's holding what you expect. It seems from the error that item will be a one element sequence, and you expect it to be at least 11 elements long.
2. RE: EDS help
- Posted by Jonas Temple <jtemple at yhti.net> Jun 19, 2003
- 406 views
Okay, I'll take a stab.... > item=db_record_data(1) > > ? item > --I think the problem is here! > --reorganize data > upc=item[11..11]&item[13..17]&item[19..24] > code=item[25..31] > descrip=item[33..63] > dept=item[73..75] > > --replace data > db_replace(1, {upc, code, descrip, dept}) > > --bottom of loop (eventually) > db_dump > --close database > db_close Maybe should be: > upc=item[1][11..11]&item[1][13..17]&item[1][19..24] > code=item[1][25..31] > descrip=item[1][33..63] > dept=item[1][73..75] Because in your ex.err item is {{xxxxxx}} which means a sequence made up of one sequence. So when you say item[11] that doesn't work because the top-most level of item only has a length of one. You should be referencing item[1][11]. HTH, Jonas