Function opens a text file for write only access using the WriteLine and WriteString functions.

 

If the file already exists, any information contained in the file will be erased.

If the file cannot be opened, the function will return FALSE or Zero.

 

If a colon is included in the path, then the path is literal and used as is, so you can open any file in any folder. If a colon is not included, then the path is relative to the Trading Blox directory. If a // is included, then the path is literal so you can access any file on any folder on any server.

 

If the file name includes a colon, then the file name is considered a full path, and that full path will be used.

If the file name starts with \\ then the file name is considered a full path to a server location.

If the file name does not contain a colon or \\, then the file name is considered relative to the main Trading Blox folder.

 

Syntax:

fileNumber = fileManager.OpenWrite( aFullFileName )

 

Parameter:

Description:

aFullFileName

The file and path names for the file to open.

 

Example:

'  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
VARIABLES: fileNumber   Type: Integer
VARIABLES: lineString Type: String
'  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'  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 file.
  fileManager.WriteLine( fileNumber, lineString )
 
  '  Another way to write the same thing as above.
  fileManager.WriteLine( fileNumber, instrument.symbol, instrument.close
 
  '  Close the file.
  fileManager.Close( fileNumber )
ENDIF '  fileNumber > 0
'  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Returns:

fileNumber =  File identification number required to access the file when opened successful; Zero if not successful.

 

Links:

 

See Also:

File Manager

 


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


Topic ID#: 445

 

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