     /*******************************************************/
     /*               TOP 15 MESSAGE WRITERS                */
     /* This report script will create a report of the top  */
     /* 15 Message Writers, excluding SYSOP.                */
     /*******************************************************/

START

VIRTUAL

  userfile      STRING  32      "D:\GAP\MAIN\USERS.DAT"
  username      STRING  32      sysop <> 1 ? STRIP(first) # " " # STRIP(last) :
                                "SYSOP"

SEARCH 

  FILE userfile USING_KEY user_index

SELECT

  sysop <> 1

SORT USING_KEY                      /* format report according to the      */
                                    /* following fields.                   */
  DSC_INTEGER   messages_left       /*  By uploads    (decending order)    */
  NO_MOD        last                /*  By last name  (ascending order)    */
  NO_MOD        first               /*  By first name (ascending order)    */

DISPLAY

  DEVICE        OUTFILE
  PAGE_LENGTH   0                     /* no page formatting  */
  BODY_COUNT    15                    /* 1st 15 records only */

IMAGE

REPORT_HDR

+                   TOP MESSAGE WRITERS - As Of @xxxxxxx
                                                SYS_DATE
+
+                          TOP 15 MESSAGE WRITERS
+
+          Name                               Messages Written
+          =====================================================
BODY
+          @xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx    @99999
           username                           messages_left


EXIT
