, ,

Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community

Failure of readnext in code (None Specified)

At 05 SEP 1999 01:56:59PM Blair Massey wrote:

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=1

UNTIL EOF

 row='
 Read @RECORD from filein, @ID Then
  • process stuff
 End

REPEAT

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


At 05 SEP 1999 04:59PM Donald Bakke wrote:

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.

[email protected]

SRP Computer Solutions


At 06 SEP 1999 09:32AM Blair Massey wrote:

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=1

UNTIL EOF

row='
@MV=@ID
@ID=@ID

Repeat

Thanks!

Blair


At 06 SEP 1999 09:57AM Donald Bakke wrote:

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

[email protected]

SRP Computer Solutions


At 06 SEP 1999 08:01PM Blair Massey wrote:

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)


At 06 SEP 1999 11:03PM Donald Bakke wrote:

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.

[email protected]

SRP Computer Solutions

View this thread on the Works forum...