Insert another line of code before line 003 below:
IF @NI = 1 THEN RUNNING.TOTAL = 0
And you won't need another routine to zero it out. The first record
with @NI equal to 1 will take care of it.
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Tom Dodds
Sent: Tuesday, October 25, 2005 1:59 PM
To: [email protected]
Subject: RE: [U2] Running Totals Universe
If you set up an I-Type that calls a subroutine with a named common
where you keep adding the field you want the running total on into the
named common variable and use the named common value as your answer it
will give you a running total.
0001: I
0002: SUBR("RUNBABY",ANS)
...
0001: SUBROUTINE RUNBABY(RUNNING.TOTAL)
0002: COM /RUNRUN/ RUNNING.TOTAL
0003: RUNNING.TOTAL += @RECORD<nn>
0004: END
I haven't done this for a while, but I think that is the syntax.
The problem with this is that you have to create another routine to
clearout the named common if you want to run the list more than once
during a session. I used to do mine in a Paragraph and have the clear
out routine as a part of the Paragraph just before the list statement.
hth
Tom Dodds
[EMAIL PROTECTED]
630-235-2975
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/