Rewrite Procedure

Applies to TestComplete 15.64, last modified on June 12, 2024

The Rewrite procedure creates a new file and opens it for recording.


Rewrite(FileVarRecSize) Parameters
FileVar [in] Required Variant
RecSize [in] Optional Integer
Result     None  


The Rewrite procedure is the only procedure that creates a new file. If the specified file already exists, the Rewrite procedure deletes its contents and moves the file pointer to the beginning of the file. If the specified file is already open, it is closed and recreated. If the file with the specified name does not exist, a new file is created. All of the files are associated with the specified file variable by calling the AssignFile procedure.


The procedure has the following parameter:


Specifies the file variable, which is associated with an external file by calling the AssignFile procedure.


Specifies the record size (in bytes) to be used for data transfer.

Note: The RecSize parameter can be specified only for binary files. If this parameter is specified for a text file, an error occurs. If the parameter is omitted for a binary file, it is treated as a text file.

See Also

DelphiScript - List of Supported Routines and Variables

Highlight search results