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.



fileNumber = fileManager.OpenRead( aFullFileName )





The file and path names for the file to open.



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


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


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



OpenAppend, OpenWrite, WriteLine, WriteString

See Also:

File Manager


Edit Time: 5/19/2017 8:00:26 AM

Topic ID#: 444


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