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

  1. /*
  2.  * File......: PRINFILE.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_PRINTFILE()
  24.  *  $CATEGORY$
  25.  *      File I/O
  26.  *  $ONELINER$
  27.  *      Output text to a file
  28.  *  $SYNTAX$
  29.  *      GT_PrintFile( nDown , cWhat , nLeftMgn , nHandle )
  30.  *  $ARGUMENTS$
  31.  *      nDown    - Number of rows to move down
  32.  *      cWhat    - Text to be output
  33.  *      nLeftMgn - Left margin of text
  34.  *      nHandle  - Handle of text file
  35.  *  $RETURNS$
  36.  *      NIl
  37.  *  $DESCRIPTION$
  38.  *      Outputs the given text to a text file
  39.  *  $EXAMPLES$
  40.  *
  41.  *  $SEEALSO$
  42.  *
  43.  *  $INCLUDE$
  44.  *      GT_LIB.CH
  45.  *  $END$
  46.  */
  47. *
  48. #include "GT_LIB.CH"
  49.  
  50. FUNCTION GT_PrintFile( nDown , cWhat , nLeftMgn , nHandle )
  51.  
  52. /*****************************************************************************
  53.  Purpose - Output text to file
  54.  Returns - None
  55.  Author  - Martin Colloby
  56.  Created - 04/24/92
  57.  Edited  - 25/4/92 by Martin Colloby - Tidied up
  58. ******************************************************************************
  59.  Parameters - nDown    - Number of rows to move down
  60.               cWhat    - Text to be output
  61.               nLeftMgn - Left margin of text
  62.  Privates   - None
  63.  Locals     - None
  64.  Externals  - None
  65. *****************************************************************************/
  66.  
  67. LOCAL nCount := 0
  68.  
  69. DEFAULT nDown TO 1 , cWhat TO "" , nLeftMgn TO 0
  70.  
  71. * Move down the required number of rows
  72. FOR nCount := 1 TO nDown
  73.     FWRITE( nHandle , CHR( K_RETURN ) + CHR( K_CTRL_J ) )
  74. NEXT nCount
  75.  
  76. * Output the text
  77. FWRITE( nHandle , SPACE( nLeftMgn) + cWhat )
  78.  
  79. RETURN NIL
  80. *
  81.