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

  1. /*
  2.  * File......: PHEADER.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_PAGEHEADER()
  24.  *  $CATEGORY$
  25.  *      Printer
  26.  *  $ONELINER$
  27.  *      Output a standard page header
  28.  *  $SYNTAX$
  29.  *      GT_PageHeader( cRepName, lPageReset, nLeftMgn, nRightMgn, ;
  30.  *                     nPageWidth , nHeader )
  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.  *  $RETURNS$
  39.  *      NIL
  40.  *  $DESCRIPTION$
  41.  *      Outputs a double lined box structure containing the name of the
  42.  *      system, report and user, the date and time, and the page number.
  43.  *  $EXAMPLES$
  44.  *
  45.  *  $SEEALSO$
  46.  *
  47.  *  $INCLUDE$
  48.  *      GT_LIB.CH
  49.  *  $END$
  50.  */
  51. *
  52. #include "GT_LIB.CH"
  53.  
  54. FUNCTION GT_PageHeader( cRepName, lPageReset, nLeftMgn, nRightMgn, ;
  55.                         nPageWidth , nHeader )
  56.  
  57. /*****************************************************************************
  58.  Purpose - Output a page header consisting of the System Name , Report Name ,
  59.            User Name , Date and Time
  60.  Returns - None
  61.  Author  - Martin Colloby
  62.  Created - March 1992
  63.  Edited  - 25/4/92 by Martin Colloby - Tidied up
  64. ******************************************************************************
  65.  Parameters - cRepName    - Report name
  66.               lPageReset  - If .T., reset the page number count
  67.               nLeftMgn    - Left margin of page
  68.               nRightMgn   - Right margin of page
  69.               nPageWidth  - Width of page
  70.               nHeader     - Row on which to start header
  71.  Privates   - None
  72.  Locals     - None
  73.  PUBLICS    - cSystemName - Name of system
  74.               cUserName   - Name of user
  75.  Statics    - nPageNum    - Page number
  76.               nConfMess   - "Private and Confidential" message
  77. *****************************************************************************/
  78.  
  79. STATIC nPageNum := 0
  80. STATIC cConfMess := "P R I V A T E   A N D   C O N F I D E N T I A L"
  81.  
  82. DEFAULT lPageReset TO .F.
  83.  
  84. IF lPageReset
  85.     nPageNum := 1
  86. ELSE
  87.     EJECT
  88.     SETPRC( 0, 0 )
  89.     nPageNum++
  90. ENDIF
  91.  
  92. GT_NextRow( nHeader , "╔" + REPLICATE( "═", nPageWidth -;
  93.                         nLeftMgn - nRightMgn - 2 ) + "╗" , nLeftMgn )
  94. GT_NextRow( 1 , "║ " + cSystemName , nLeftMgn )
  95. GT_SameRow( nPageWidth - nRightMgn - LEN( cRepName ) - 2 , cRepName + " ║" , 0 )
  96. GT_NextRow( 1, "╠" + REPLICATE( "═",nPageWidth - nLeftMgn - nRightMgn - 2 ) + "╣", nLeftMgn )
  97. GT_NextRow( 1, "║ Printed By : " + cUserName , nLeftMgn )
  98. GT_SameRow( nPageWidth - nRightMgn - 36 , "Date " + DTOC( DATE() ) , 0 )
  99. GT_SameRow( PCOL() + 1 , "Time " + LEFT( TIME(), 5 ) , 0 )
  100. GT_SameRow( PCOL() + 1 , "Page " + TRANSFORM( STR( nPageNum, 4 ), "9999" ) + " ║" , 0 )
  101. GT_NextRow( 1 , "╚" + REPLICATE( "═",nPageWidth - nLeftMgn - nRightMgn - 2 ) + "╝" , nLeftMgn )
  102. GT_NextRow( 1 )
  103. GT_SameRow( nLeftMgn + ( nPageWidth - nRightMgn - LEN( cConfMess ) ) / 2 , cConfMess , 0 )
  104.  
  105. RETURN NIL
  106. *
  107.