Close

Top  Previous  Next

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 )

 

Parameters

file number

 

file number if more than one file has been opened.

 

Example

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 )

 

   ' Close the file.

   fileManager.Close( fileNumber )

 

ENDIF