Bill
  The first thing I would try is to try browsing the table using the where 
clause you have for the declare. It seems that nothing is returning with the 
where clause.
 
  You could also do a count 
 
 SEL COUNT(*)INTO VROWS INDIC IVROWS FROM tCashd2 whe rec#=.vrec# and 
cdtrantype='C'
 
If vrows = 0 then
  PAUSE 2 USI 'nothing found' 
  GOTO Done
Endif
 
 Another thing since your table is beginning with a lower case t I'm assuming 
it is a temp table. Does it exist.
 
Buddy
 

________________________________

From: [email protected] on behalf of Bill Eyring
Sent: Sun 7/5/2009 3:44 PM
To: RBASE-L Mailing List
Subject: [RBASE-L] - Rbase Editor Trace Problem



I have a piece of code which I am trying to trace. This code is a declare
cursor operation.

When I try to trace this code, the trace entirely skips the while loop so
that I cannot see what is going in in the while loop.

Here is my code;
1.  SET ERROR MESSAGE 705 OFF
2.  drop cursor c#1
3.  SET ERROR MESSAGE 705 ON
4.  declare c#1 cursor for select idno,cddr fro tCashd2 +
      whe rec#=.vrec# and cdtrantype='C'
5.  open c#1
6.  fetch c#1 into vidno vi1,vcddr vi2
7.  while sqlcode <> 100 the
8.    sel sum CDdr,sum CDcr into vSumDrCashD vi3,vSumCrCashD vi4 fro tCashd2
+
       whe cno=.vidno and rec#=.vrec#
9.    set v vidnodiff=(.vSumDrCashD-.vSumCrCashD)
10.   if vidnodiff > 0.00 the
11.     update tCashd2 set cddr=(.vcddr-.vidnodiff) +
12.       whe cno=.vidno and cdtrantype='c'
13.   endi
14.   if vidnodiff < 0.00 the
15.     update tCashd2 set cddr=(.vcddr+.vidnodiff) +
          whe cno=.vidno and cdtrantype='c'
16.   endi
17.   fetch c#1 into vidno vi1,vcddr vi2
18. endwhile
19. SET ERROR MESSAGE 705 OFF
20. drop cursor c#1
21. ret

All my variables have been pre-defined before this code. When I use the
trace command, it steps through Lines 1 to 6. When it hits line 7 ot skips
all the way to line 18 so I never see the code stepping through the While
loop.

I have never seen this behavior before and I'm wondering if anyone can help
me correct the problem. Is it a setting in Rbase Editor ? I have put the
code through RStyle with no errors reported.



Any help would be appreciated







Reply via email to