FileManager

Top  Previous  Next

The FileManager object allows importing and exporting of data via files.Multiple files can be opened at the same time.

 

 

 

 

OpenRead

 

opens a file for reading

OpenWrite

 

opens a file for writing

Close

 

closes the file

WriteLine

 

writes a string to the file appending a new line character

WriteString

 

writes a string to the file without a new line character

ReadLine

 

reads a line from a file into a string variable

EndOfFile or EOF

 

returns TRUE if the end of the file is reached

PartialLine

 

returns TRUE if the entire line was not read fully by ReadLine

defaultFolder

 

returns the default folder used by the file manager for locating files. This is also the main Trading Blox folder.

CountLines

 

returns the number of lines in the file. Takes the file number as a parameter

 

See string functions GetField for use in parsing the input from files.

 

NOTE: If you are opening multiple files be sure to save the File Numbers into BPV Integer Variables for future use. If you save into a temp local variable then it will be lost. Normally one would open the files in the Before Test script and close in the After test script. The BPV Integer File Number variables can then be used to read and write from the various files at the same time. When using the OpenAppend the file can be closed and opened multiple times during the test, since the writing will always be appended to the end of the file.