Rewrite Procedure

Applies to TestComplete 14.40, last modified on April 22, 2021

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

Declaration

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

Description

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.

Parameters

The procedure has the following parameter:

FileVar

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

RecSize

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
Append
AssignFile
Reset

Highlight search results