2.14.1.5 filelog

Brief Information

<<<For internal use only>>> Create a .txt file that contains notes or records of the user's work through a string

Command Line Usage

 1. filelog str:="Part 1 has been done."; // Output string to LogFile.txt under UFF 

2. filelog str:="Start to test Part 2." newline:=1; // Start a new line when outputting the string 

3. filelog str:="Begining" fname:=test path:=C:\ clear:=1; // specify the txt file to output 

Variables

Display
Name
Variable
Name
I/O
and
Type
Default
Value
Description
Information str

Input

string

The variable specifies the input for the log file.
File Name fname

Input

string

LogFile.txt
This variable specifies the name of the file. The default name is LogFile.txt
File Path path

Input

string

This variable specifies the path of the file.
Add New Line at First newline

Input

int

0
Whether or not add a blank line at first. The default setting is not adding new line.
Clear Log File Data clear

Input

int

0
Specifies whether or not to clear the log file. The default setting is not clearing this file.

Description

This X-function can be used to create a .txt file that contains notes or records of the user's work through a string.

Examples

This example summarizes the number of columns of all worksheets and outputs into a logfile. The example is also using LabTalk document command

filelog str:="Summary of column numbers: " fname:=test path:=C:\ clear:=1; // create logfile with name text.txt
// loop over all worksheets, skip matrices.
doc -e LB {
if(exist(%H,2)==0) //not a workbook, must be a matrix
continue;
int nn = wks.nCols;
string str=wks.Name$; filelog str:="[%H]%(str$) has \$(nn) columns" fname:=test path:=C:\ newline:=1; // output to logfile
}

Keywords:-