The WriteString function writes a list of string expressions to a file that was previously opened with OpenWrite. It does not write the windows end-of-line character like WriteLine does. If multiple parameters are passed, they are not separated by commas, so you can control the exact characters being output.



fileManager.WriteString( fileNumber [, expression] [,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
  '  Write out the date to the current file.
  fileManager.WriteString( fileNumber, instrument.date, "," )
  '  Construct another line.
  lineString = instrument.symbol + "," + instrument.close
  '  Write out the line to the current file.
  fileManager.WriteString( fileNumber, lineString )
  '  Write out the end-of-line character sequence.
  fileManager.WriteLine( fileNumber )
  '  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:19:30 AM

Topic ID#: 655


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