Function writes an optional list of string expressions to a file that was previously opened with OpenWrite function, and then writes the Windows End-of-Line character sequence after all the expressions have been written.


If no expressions, or numeric variables are supplied, then WriteLine just writes the End-of-Line character sequence.


For Windows, the End-of-Line sequence is ASCII character 10 for Line Feed. Windows text  file editors like NotePad will interpret this sequence as the start of a new line.  If more than one parameter is passed, they are separated by commas for ease of using CSV formatting to simplify file use in spreadsheet programs.



fileManager.WriteLine( fileNumber [, expression2] [, expression2] [, etc...] )





The file number, when more than one file has been opened.

[, expression]

Optional: The first string expression to write.

[, expression2]

Optional:  The second string expression to write.


Optional: Any other string expression to write.



VARIABLES: lineString Type: String
VARIABLES: fileNumber Type: Integer
'  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'  Open the file.
fileNumber = fileManager.OpenWrite( "C:\FileToOpen.txt" )
If fileNumber > 0 THEN
  '  Construct the line.
  lineString = instrument.symbol + "," + instrument.close
  '  Write out the line to the current file.
  fileManager.WriteLine( fileNumber, lineString )
  '  Another format for the above.
  fileManager.WriteLine( fileNumber, instrument.symbol, instrument.close )
  '  Close the file.
  fileManager.Close( fileNumber )
ENDIF '  fileNumber > 0
'  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


No information is is returned.



Close, OpenWrite

See Also:

File Manager


Edit Time: 5/19/2017 9:17:48 AM

Topic ID#: 654


Created with Help & Manual 7 and styled with Premium Pack Version 2.80 © by EC Software