     /*******************************************************/
     /* This report script will create a report the top     */
     /* file contributors (those that have a                */
     /* download/upload ration of 10 or less (less being    */
     /* best.                                               */
     /*******************************************************/

START

VIRTUAL

  userfile      STRING  32      "C:\GAP\MAIN\USERS.DAT"
  username      STRING  32      sysop <> 1 ? STRIP(first) # " " # STRIP(last) :
                                "SYSOP"
  ratio         INT2     2      (downloads = 0 AND uploads = 0)
                                 ? 0 : downloads / uploads

  divider       INT2     2      uploads = 0 ? 0 : 1


SEARCH 

  FILE userfile USING_KEY user_index


SELECT

  ratio <= 10 AND ratio <> 0 AND divider <> 0

SORT USING_KEY                      /* format report according to the      */
                                    /* following fields.                   */
  NO_MOD        ratio               /*  Ratio (ascending order - best 1st) */
  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 */


IMAGE

REPORT_HDR

+
+
+                            TOP CONTRIBUTORS
+
+    Name                               Uploads  Downloads      Ratio
+    =================================================================
BODY
+    @xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx     @9999     @9999    @9999 to @
     username                            uploads   downloads  ratio divider



EXIT
