The OpenRead function opens a text file for reading.  If the file is opened successfully, the File Number is returned.  The file can then be read using the ReadLine function.

 

If the file does not exist, the function returns 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.OpenRead( aFullFileName )

 

Parameter:

Description:

aFullFileName

The file and path names for the file to open.

 

Example:

'  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
VARIABLES: fileNumber   Type: Integer
'  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'  Open the file.
If fileManager.OpenRead( "C:\FileToOpen.txt" ) THEN
PRINT "File Opened Successfully"
ENDIF

 
OR

'  Open the file.
fileNumber = fileManager.OpenRead( "C:\FileToOpen.txt" )
 
If fileNumber > 0 THEN
  PRINT "File Number", fileNumber, "Opened Successfully"
ENDIF
'  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Returns:

fileNumber = File identification number when file is successfully opened for Read only access.

 

Links:

OpenAppend, OpenWrite, WriteLine, WriteString

See Also:

File Manager

 


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


Topic ID#: 444

 

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