home *** CD-ROM | disk | FTP | other *** search
/ Power CD-ROM!! 7 / POWERCD7.ISO / prgmming / clipper / fheader.prg < prev    next >
Text File  |  1993-10-14  |  3KB  |  107 lines

  1. /*
  2.  * File......: FHEADER.PRG
  3.  * Author....: Martin Colloby
  4.  * BBS.......: The Dark Knight Returns
  5.  * Net/Node..: 050/069
  6.  * User Name.: Martin Colloby
  7.  * Date......: 18/4/93
  8.  * Revision..: 1.0
  9.  *
  10.  * This is an original work by Martin Colloby and is placed in the public
  11.  * domain.
  12.  *
  13.  * Modification history:
  14.  * ---------------------
  15.  *
  16.  * $Log$
  17.  *
  18.  */
  19.  
  20.  
  21. /*  $DOC$
  22.  *  $FUNCNAME$
  23.  *      GT_PAGEFHEADER()
  24.  *  $CATEGORY$
  25.  *      File I/O
  26.  *  $ONELINER$
  27.  *      Outputs a page header to a text file
  28.  *  $SYNTAX$
  29.  *      GT_PageFHeader( cRepName, lPageReset, nLeftMgn, nRightMgn, ;
  30.  *                      nPageWidth , nHeader , nHandle )
  31.  *  $ARGUMENTS$
  32.  *      cRepName    - Report name
  33.  *      lPageReset  - If .T., reset the page number count
  34.  *      nLeftMgn    - Left margin of page
  35.  *      nRightMgn   - Right margin of page
  36.  *      nPageWidth  - Width of page
  37.  *      nHeader     - Row on which to start header
  38.  *      nHandle     - Handle for binary file
  39.  *  $RETURNS$
  40.  *      NIL
  41.  *  $DESCRIPTION$
  42.  *      Output a page header consisting of the System Name , Report Name ,
  43.  *      User Name , Date and Time to a file
  44.  *  $EXAMPLES$
  45.  *
  46.  *  $SEEALSO$
  47.  *
  48.  *  $INCLUDE$
  49.  *      GT_LIB.CH
  50.  *  $END$
  51.  */
  52.  
  53. *
  54. #include "GT_LIB.CH"
  55.  
  56. FUNCTION GT_PageFHeader( cRepName, lPageReset, nLeftMgn, nRightMgn, ;
  57.                          nPageWidth , nHeader , nHandle )
  58.  
  59. /*****************************************************************************
  60.  Purpose - Output a page header consisting of the System Name , Report Name ,
  61.            User Name , Date and Time
  62.  Returns - None
  63.  Author  - Martin Colloby
  64.  Created - March 1992
  65.  Edited  - 25/4/92 by Martin Colloby - Tidied up
  66. ******************************************************************************
  67.  Parameters - cRepName    - Report name
  68.               lPageReset  - If .T., reset the page number count
  69.               nLeftMgn    - Left margin of page
  70.               nRightMgn   - Right margin of page
  71.               nPageWidth  - Width of page
  72.               nHeader     - Row on which to start header
  73.  Privates   - None
  74.  Locals     - None
  75.  PUBLICS    - cSystemName - Name of system
  76.               cUserName   - Name of user
  77.  Statics    - nPageNum    - Page number
  78.               nConfMess   - "Private and Confidential" message
  79. *****************************************************************************/
  80.  
  81. STATIC nPageNum := 0
  82.  
  83. DEFAULT lPageReset TO .F., nHandle TO -1
  84.  
  85. IF lPageReset
  86.     nPageNum := 1
  87. ELSE
  88.     FWRITE( nHandle , CHR( 12 ) )
  89.     nPageNum++
  90. ENDIF
  91.  
  92. GT_PrintFile( nHeader , "╔" + REPLICATE( "═", nPageWidth -;
  93.                         nLeftMgn - nRightMgn - 2 ) + "╗" , nLeftMgn , nHandle )
  94. GT_PrintFile( 1 , "║ " + cSystemName + ;
  95.               SPACE( nPageWidth - nRightMgn - LEN( cRepName ) - 4 - LEN( cSystemName ) - nLeftMgn ) + ;
  96.               cRepName + " ║" , nLeftMgn , nHandle )
  97. GT_PrintFile( 1, "╠" + REPLICATE( "═",nPageWidth - nLeftMgn - nRightMgn - 2 ) + "╣", nLeftMgn , nHandle )
  98. GT_PrintFile( 1, "║ Printed By : " + cUserName + ;
  99.               SPACE( nPageWidth - nRightMgn - 55 - 4 ) + ;
  100.               "Date " + DTOC( DATE() ) + " " + ;
  101.               "Time " + LEFT( TIME(), 5 ) + " " + ;
  102.               "Page " + TRANSFORM( STR( nPageNum, 3 ), "999" ) + " ║" , nLeftMgn , nHandle )
  103. GT_PrintFile( 1 , "╚" + REPLICATE( "═",nPageWidth - nLeftMgn - nRightMgn - 2 ) + "╝" , nLeftMgn , nHandle )
  104.  
  105. RETURN NIL
  106. *
  107.