SaveLog Procedure

Saves the current Log window contents to a file.

Syntax

enSaveLog = SaveLog ( sFilename, bAppend )

The SaveLog procedure syntax has the following parts:

 

Name

Type

Description

enSaveLog

enumALogSave

Return the status of the save function

sFilename

Val BString

File name to save the contents of the log window

bAppend

Val Bool

When True the function will append the log window content to the specified file. Default value is False - overwrite the file contents.

Where

enumALogSave can have one of the following values:

 

Name

Value

Description

alogSaveOk

0 *

Successful save

alogSaveCanceled

1

User selected Cancel when prompt to provide a file name to select

alogSaveFailed

 

2

Failed to save the file since the Log variable is Nothing or ATEasy cannot create, open or save the specified file

Comments

If the sFileName parameter is omitted, the Save As dialog box will appear asking the user to select a file name and file type.

The saved file format is determined by the following rules:

If the sFilename is given without a directory, the file is saved to the application current directory.

When running the application as a stand alone mode (EXE file) the Log internal variable must be set to an application Form Log control. If the Log variable is empty (Nothing), the function return alogSaveFail.

Calling Log.SaveAs is similar to calling this function.

Example

The following example saves the Log to a file name made up from the serial number entered by the user.

OnEndProgram ( )

{

sSerNum=GetProgramSerialNum()

if SaveLog(Left(sSerNum, 8)+".LOG")=alogSaveFailed

MsgBox("error saving log file")

endif

}

 

See Also

Log, PrintLog