modifying Select statements to create a subtotal of items selected

Darren Reely darren.reely@latticesemi.com
Wed, 29 Aug 2001 11:07:02 -0700


> Rendell Requiro wrote:
> 
> Hello,
> 
> Anyone have experience modifying the default SELECT procedure to create a
> subtotal based upon the field(s) SELECTED with SELECT verbs?  Try saying
> that three times quickly.  I would like to create a total amount at the
> bottom of the screen that totals values for only the selected records.
> If there is no selection, my WHILE RETRIEVING of an alias of the file
> works just fine.

Assuming your dealing with a displayed cluster...

Perhaps this will work:

PROCEDURE POSTFIND
BEGIN
	LET MY_TOTAL = 0
	FOR EACH DETAIL_LINE
	LET MY_TOTAL = MY_TOTAL + QTY OF DETAIL_LINE
END

If you already have a 'FOR MISSING' clause in the FIND procedure you could
perform the calculation right there within BEGIN/END statements.

Darren