Dan
  I use something like this which gives the count plus gives you a meter graph.
 
 Buddy
 
SET VAR v1 INTEGER = 0
SET VAR v2  = NULL
SET VAR v3  = NULL
SET VAR v4  = 0
SELECT COUNT(*)INTO v4 INDICATOR iv4 FROM tmpactuals
SET VAR vrows  = 0
SET VAR vmsg = ('Working on 0000 Out of' & (CTXT(.v4)))
PAUSE 3 USING .vmsg CAPTION 'Actual Monthly Payments'
 
DROP CURSOR c1
DECLARE c1 CURSOR FOR SELECT ssnnumber FROM tmpactuals
OPEN c1
FETCH c1 INTO vssn INDICATOR ivssn
WHILE SQLCODE <> 100 THEN
  SET VAR v1 = (.v1+1)
  SET VAR vmsg = ('Working on' & (CTXT(.v1)) & 'Out of' & (CTXT(.v4)))
  SET VAR v2 = ((.v1/.v4)*100)
  SET VAR v3 = (NINT(.v2))
  SET VAR vcommand = +
  'PAUSE 4 USING .VMsg +
  OPTION METER_VISIBLE ON|METER_TYPE Bar3D|METER_VALUE ' + (CTXT(.v3))
  &vcommand
  ........ 
ENDWHILE
 
 ----- Original Message -----
From: Dan
Sent: Wednesday, October 20, 2004 10:16 PM
Subject: [RBG7-L] - Displaying Running Counts

In Previous versions of rbase when using a declare cursor command to update rows I would set a variable to count down the progress of the update. To display it I would use the write command.  The only way I have found in the new version to display a running count is to use the pause 3 command.  

IE:

set var i=1

set var vrows=rows in audience

fetch cursor1 into vcomboid,vdaypartid

while sqlcode <> 100 and (lastkey(0))<>'[esc]' then

  set var vmess=('Updating Arbitron Dayparts'+(CHAR(013))+(CHAR(013)))

  set var vmess=(.vmess+'Row '+(ctxt(.i))+' of '+(ctxt(.vrows)))

  pause 3 using .vmess

  set var i=(.i+1)

  fetch cursor1 into vcomboid,vdaypartid

endwhile

closewindow

 

This works but I'm wondering if anyone knows of a better way to accomplish this.

 

Thanks Dan

 

 

Reply via email to