Scott,

Are you using WHILE / ENDWHILE or GOTOs and LABELs to control the loop?

One thing to avoid inside such loops is DECLARE CURSOR. If you do this, move the cursor declaration outside the loop, having declared and typed any necessary variables, then inside the loop use OPEN RESET / CLOSE instead of OPEN / DROP. When you use OPEN RESET the cursor declaration is reevaluated with the current values for any variables in the WHERE clause.

If you are using WHILE / ENDWHILE, declare and type all variables outside the loop. You mention a "nested loop" - do you have a WHILE / ENDWHILE inside another WHILE / ENWHILE? If so, make certain *all* variables are declared and typed before the outer loop.

Will it run to completion on TRACE? If so, and you're using WHILE / ENDWHILE, examine the code inside the loop very carefully, as TRACE turns WHILEOPT OFF when it runs. Try setting WHILEOPT OFF under normal conditions to see if that makes a difference.

Also, I find it is not good practice to use GOTO in a SWITCH / CASE structure. Instead, set up a variable vlabel for the label you want to go to, then GOTO &vlabel after the ENDSW. Also avoid RUN statements inside SWITCH / CASE blocks, especially if the SWITCH is inside a WHILE loop. In fact, RUN from anywhere inside a WHILE loop is a bad idea, and is compounded if WHILEOPT is ON.

Several of the above conditions can contribute to memory not being released.


We are using 7.1 and patch 81 and I have a problem with a nested loop.  At
row 4800 (4800 times through the loop), Rbase pops a Pause box up that says
"out of system resources".  After pressing the continue icon, Rbase
disappears from the screen.  We have "set files 255" and in the Windows XP
Pro Task Manager, I can watch Rbase memory slowly creep up from 16 megs to
41 megs just as it quits.  Any suggestions would be much appreciated as
we're totally down.... This is a very stable application that has just quit
working.

Scott Sherer

Emmitt Dove
Manager, DairyPak Business Systems
Blue Ridge Paper Products, Inc.
40 Lindeman Drive
Trumbull, CT  06611
(203) 673-2231
[EMAIL PROTECTED]
[EMAIL PROTECTED]

Reply via email to