log

Writes text to a file.

Available in:

Apps (win) Apps (char) Reportwriter RPC Standalone PL
X X X X X

Syntax

string log(file-name,text)
string     file-name,text

Description

Writes text to logfile. Closes file after each write so no data is lost by a system crash or similar disaster.
file-name specifies the name of the logfile. Whenever a file name is specified the extended file names are available. Be sure to give a complete file specification.

text specifies the text to append to the file.

Example

Logs two messages to a specified file and print the messages.
{
 list xx;
 log ("ttt", "whoa");
 log ("ttt", "nelly");
 xx = list_open("ttt", 1000);
 printf(list_read(xx,0));
 list_seek(xx,1);
 printf(list_read(xx,0));
}