Re: For loop variables reported incorrectly in ex.err file
- Posted by Robert Craig <rds at RapidEuphoria.com> Feb 07, 2004
- 511 views
Pete Lomax wrote: > The following test program demonstrates the problem: > > procedure t(integer i) > for j=i to i do > if i=1 then ?9/0 end if > t(i-1) > end for > end procedure > t(3) > > It creates the following ex.err file, clearly duplicating the current > value of j rather than showing the correct value from the calling > scope: > > C:\test.exw:3 in procedure t() > attempt to divide by 0 > i = 1 > j = 1 > > ... called from C:\test.exw:4 in procedure t() > i = 2 > j = 1 > > ... called from C:\test.exw:4 in procedure t() > > i = 3 > j = 1 Thanks. I recall there's something special about mixing for loops with recursion. I'll fix the code that generates ex.err files. Regards, Rob Craig Rapid Deployment Software http://www.RapidEuphoria.com