Problem with @rn.counter (AREV Specific)
At 27 JUN 2007 05:53:48AM Peter Bowyer wrote:
We are suddenly getting problems with READNEXT failing after reading the first key from a large select list. No errors are thrown up but on investigation by debugging the routine we found that @rn.counter was set much higher than the total keys to be read. If you reset the value to 1 after the first iteration then everything works fine. This has only started happening recently.
Set up is Arev 3, UD3, Server 2003
At 27 JUN 2007 09:53AM Michael Slack wrote:
Hello Peter:
Your situation sounds simular to one I encountered some time ago. I found that my active select list had null values. Thus I created the snippet of code below. Now, any time I read from an active select list with a READNEXT I cut and paste and modify this piece of code into my program. I do it mainly for the comments so anyone else coming along later can figure out why I did it this way.I hope this helps.Michael Slack
EOL =FALSE$ ;* EOL IS END OF LOOP
LOOP
READNEXT HELP_ID ELSE EOL=TRUE$UNTIL EOL
IN A PREVIOUS PROGRAM, I RAN ACROSS A SITUATION WHERE THE
READNEXT VALUE WAS NULL BUT THE ACTIVE SELECT LIST WASN'T
FINISHED YET. SO ADDED CHECK FOR NULL VALUE. IF NULL THEN
IGNORE IT, OTHERWISE CONTINUE PROCESSING AS NORMAL.
SEE R/BASIC MANUAL, PAGE 281, 'NOTE' SECTION ON THE 'ELSE' PART
OF THE 'READNEXT' FOR MORE INFORMATION ON GETTING NULLS THRU A
READNEXT STATEMENT.IF HELP_ID=' ELSE.........ENDREPEAT
At 27 JUN 2007 10:37AM Peter Bowyer wrote:
Hi Michael,
Not quite the same as there are no null values in the keys. However reading the help you pointed me to says that you should always set @rn.counter before using READNEXT, something I've never done in some 20 years of Rev/Arev programming. Never too late to learn I guess!