Read procedure reads one line from the specified file.
Reads one line from the file, which is associated with the file variable by calling the
AssignFile procedure, then assigns this line to the specified variable.
The procedure has the following parameters:
Specifies the file variable, which is associated with the desired file by calling the
Specifies the variable that holds the received line.
The procedure below reads all characters up to the end-of-line marker, or up to the end of the file (see
EOF). It does not skip to the next line, and every subsequent call to
Read returns an empty string. If you want to read a set of string values, use
Since TestComplete works with variant variables, the received string can be converted to any other data type. The following example demonstrates how you can work with data received from the file.
// Opens a file
AssignFile(FileVar, 'C:\My File.txt');
// Reads data from the file into the MyVar variable
// Outputs the data to the test log
// Closes the file
DelphiScript - List of Supported Routines and Variables