Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- SuperLib 3.50 - function writefile() http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 FUNCTION WRITEFILE()

  Short:
  ------
  WRITEFILE() Writes a line or lines  to a text file

  Returns:
  --------
  nothing

  Syntax:
  -------
  Writefile(cFileName|n|FileHandle,cText|aText)

  Description:
  ------------
  Writes line(s) of text with CR LF to a file
  referenced either as a file handle <nFileHandle> or a file
  name <cFileName>.

  Writes either a single line contained in <cText> or all of the
  contents of array <aText> to the file.

  Examples:
  ---------
   1. WRITEFILE('ERROR.TXT','THERE WAS AN ERROR')

   2. aErrors := array(3)
      aErrors[1] = 'There was an error'
      aErrors[2] = 'Error # 61765  '
      aErrors[3] = dtoc(date)
      writefile('ERROR.TXT',aErrors)

   3. nHandle := fopen("error.txt",1)
      aErrors := array(3)
      aErrors[1] = 'There was an error'
      aErrors[2] = 'Error # 61765  '
      aErrors[3] = dtoc(date)
      writefile(nHandle,aErrors)

  Notes:
  -------
  If a filename is passed, the file is opened and
  closed by the function.

  If a file handle is passed, the file is left open. If
  the file does not exist, it is created.

  PREVIOUSLY AN ARRAY NAME WAS PASSED. THIS MUST NOW BE
  AN ARRAY.

  Source:
  -------
  S_WRITEF.PRG


Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson