LabelVision Classic: Technical Notes

Using the Logging Utility (LOG.EXE)
This technical note explains how to use the logging utility LOG.EXE to log events when using LabelVision (such as data printed on a label with date and time it was printed), typically to an ASCII text file.

Before using the LOG utility, either copy the file LOG.EXE to your default directory, or make sure that its directory has been included in your path statement.

LOG.EXE comes with a help screen, accessed by typing "LOG /?" at the DOS command line.

The LOG utility command has the following form:

LOG [/O filename][/D] [/I] [/T] [/N] [/Sx] [/Qy] [argument1...]

By default, it outputs the arguments supplied separated by spaces and followed by a Carriage Return and a Line Feed character.

If you specify /O and a file name, the result is written to the given file instead of the screen. If the file already exists the arguments are appended to it followed by a Carriage Return and a Line Feed character.

Use the /D parameter to include the current date in the format DD-MON-YY (i.e. 21-Apr-94).

The /I parameter can be used to include the current date using the format YYYYMMDD (i.e. 19940421). This format in combination with the /S, and the /Q\" parameters is useful if you need to later import the log text file into a database using the structure editor (LSTRUCT.EXE).

Use /T to include the current time in the log file. The format is HH:MM:SS (i.e. 17:52:30).

If you specify /N, the Carriage Return and Line Feed characters will not be added to the end of the logged information. This parameter allows you to combine arguments from multiple calls to the LOG utility on the same line of the log file.

You can change the default field separator string (a blank space) by using the /S parameter. This parameter is useful to create a comma delimited text file (i.e. /S,). Enclose any parameter containing spaces in double quotes (i.e. "/S, ").

The /Q parameter allows you to select the quote character that will surround each data element (the default is no quotes). You may want to use this in order to surround arguments with double quotes. Specify /Q\" for double quotes. Note that a " must be preceded by a \ for it to be interpreted as a character and not as a quote indicating the beginning of a new argument.

The order of the command line parameters and arguments determines the order in which they are written to the log file.

Normally, when the Print Program calls a DOS program, it "swaps" itself out of DOS memory (either to disk or to EMS memory), which frees up all but about 5K of DOS memory for the DOS program. This swapping is necessary when calling any DOS program that requires more than about 50K or so of memory.

This swapping does take time. Applications which run a small DOS program will run faster if you disable swapping. The time savings is especially significant if your application repeatedly runs the DOS program..

To disable swapping, specify the /X NOSWAP option on the command line when you call the print program. If you access your application from a LabelVision menu, simply add "/X NOSWAP" to the beginning of the "Options" box in the Menu Editor's "Define Action" dialog box.

If you start your application from a DOS batch file, add "/X NOSWAP" to the LPRINT command line. The final line will be something like that shown below:


For a sample LOGFILE application, look in the SAMPLES\LOG_FILE subdirectory under your installation directory (in Version 2.1 or later).

Send mail to with questions or comments about this website.
Copyright© 2014 Flexible Information Systems, Inc.