SP_WRITEFILE

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

 

2 responses to “SP_WRITEFILE

  1. Pingback: SP File Functions | Viva Clipper !

  2. Pingback: SP Functions | Viva Clipper !

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.