In order for this site to work correctly, and for us to improve the site, we need to store a small file (called a cookie) on your computer.
By continuing to use this website, you agree to our cookies and privacy policy.
  
Home page Home page Home page Home page
Pixel
Pixel Header R1 C1 Pixel
Pixel Header R2 C1 Pixel
Pixel Header R3 C1 Pixel
Pixel

QTIPS - RLIST Average / Total Results

In issue 10 volume 3 you were challenged to provide the best way of stopping a zero length field from offsetting average/total results by one. An honourable mention goes to Daniel Diggins of Peterborough Software who suggested replacing

   BREAK-ON DIVISION "L#0" TOTAL SALARY     with
   BREAK-ON {@ANS=" ":{DIVISION}} COLHEAD " " JUSTLEN "L1" TOTAL SALARY

as he says "This works by placing a space in front of the breaking value and setting the column to one character wide".

The winner was Dave Harmacek of Harmacek Database Solutions Inc who says "I use a user-defined conversion that always returns a null value, the length is one character and the heading is a single ".". Since the output conversion is not processed in the HEADING statement, the entire value of the field is displayed. Sample code

     Subroutine Conv(Type, Passed, Branch, Returned)
          If Type = "OCONV" Then Returned = "" Else
               Returned = Passed
          End
     Return

Special mention for elegant efficiency goes to David Edkins of David Edkins & Associates for "For many years I have adopted the convention of positioning any zero length fields at the END of the R/LIST output clause. In this position they will provide all of the required effects without any of the unwanted problems".

(Volume 4, Issue 2, Pages 4,5)
Pixel
Pixel Footer R1 C1 Pixel
Pixel
Pixel
Pixel