REDIRECTOUTPUT

Action

Redirects all screen output to a file.

 

Syntax

REDIRECTOUTPUT ("file name", overwrite)

 

Parameters

File name

A string naming the file to which output should be redirected. If this parameter is an empty string (""), output is redirected to the screen. Note that output can also be redirected to the CON or NUL device.

Overwrite

Optional numeric value indicating whether to clear the output file before writing any data to it. This parameter can have the following values:

 

0

New output data appended to the existing contents of file.

1

All data in file overwritten when the output is redirected to the file.

 

Remarks

If all output is redirected to a file, the AT, BIG, BOX, and CLS commands are ignored.

Returns

 

0

Output redirected

Error code

Function failed

 

Example

IF RedirectOutput("logon.log") = 0

    ? "Opened 'logon.log' at " + @TIME ?

ENDIF