I am the victim of the oddest behavior I've seen yet out of OI 3.7. This code fragments fails:
EOF=0
cnt=0
LOOP
READNEXT @ID ELSE EOF=1UNTIL EOF
row='Read @RECORD from filein, @ID Then
process stuffEndREPEAT
When processing this code from an active select list from with in a window, with @dict, @record, And @id saved off - the program is coming up with impossible values for @ID. The ReadNext is failing on some files and working on others.
Any ideas would be most appreciated.
Blair
My first guess would be corruption/GFE's in the table or delimiters in the keys.
My second guess would be faulty indexes (if they are being used) due to insufficient lengths attributed to the dictionary record for the columns being indexed.
Thanks for your response Don. After verifing indexes and file integrity it dawned on me that what i was seeing was and exploded select list. I notices the the @id being readnext was a value like 111*1 or 132*2 or 1*. Thanks. Code has been modified to :
LOOP
READNEXT @ID ELSE EOF=1UNTIL EOF
row='@MV=@ID@ID=@IDRepeat
Thanks!
Blair
Blaire,
You're welcome. Since you said "impossible values" I just took it for granted that what you were seeing was too far off for the situation you discovered. BTW, you can also use Readnext to automatically parse the MV indicator for you. For instance:
LOOP
READNEXT @ID, @MV ELSE EOF=1
UNTIL EOF
row='
Repeat
Not familiar w/ that syntax
LOOP
READNEXT @ID, @MV ELSE EOF=1
UNTIL EOF
row='
Repeat
Will it loop through the mv's then the id's? (like a nested loop)
Blair,
It will work exactly like your loop, but with less lines of code. So, no, it is not a nested loop but rather a single loop that automatically parses the key and MV pointer from an exploded select.