The Close function closes a text file that has previously been opened using OpenRead or OpenWrite. Pass in the optional file number if more than one file has been opened.

 

Syntax:

fileManager.Close( fileNumber )

 

Parameter:

Description:

fileNumber

File number of each file opened

 

Returns:

20140531,1.1174000

 

Example:

'  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
VARIABLES: lineString Type: String
VARIABLES: fileNumber Type: Integer
'  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'  Open the file.
fileNumber = fileManager.OpenWrite( "C:\FileToOpen.txt" )
 
'  If file-number > 0, . . .    
If fileNumber > 0 THEN
  '  Create text line using the symbol, a comma delimiter
  '  and the instrument's close price
  lineString = instrument.symbol + "," + instrument.close
 
  '  Write the line to the file identified by the file-number.
  fileManager.WriteLine( fileNumber, lineString )
 
  '  Close the file identified by the file-number.
  fileManager.Close( fileNumber )
ENDIF
'  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 

Links:

Close, OpenWrite, WriteLine

See Also:

File & Disk Functions

 


Edit Time: 9/21/2020 1:46:59 PM


Topic ID#: 198

 

 

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