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.

 

Syntax:

fileManager.WriteString( fileNumber [, expression] [,expression2] [,etc...] )

 

Parameter:

Description:

fileNumber

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.

[,etc...]

Optional: Any other string expression to write.

 

Example:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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
'  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Returns:

No information is is returned.

 

Links:

Close, OpenWrite

See Also:

File Manager

 


Edit Time: 9/25/2017 09:09:58 AM


Topic ID#: 655

 

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