TraceUser

Description

Logs the activity type value you specify to the trace file.

Syntax

TraceUser (info, message )

Argument

Description

info

A long whose value is a reference number you want to associate with the logged activity

message

A string whose value is the activity type value you want to add to the trace file


Return value

ErrorReturn. This function always returns Success!.

If info or message is null, TraceUser returns null and no entry is made in the log file.

Usage

TraceUser logs an activity type value of ActUser! to the trace file. This is the default activity type and is enabled when the TraceOpen function is called. You use the TraceUser function to record your own message identifying a specific occurrence during an application run. For example, you may want to log the occurrences of a specific return value or the beginning and end of a body of code. TraceUser works just like the TraceError function except that you use TraceError to identify more severe problems. The info and message values are passed without modification to the trace file.

Examples

This example logs user messages to the trace file identifying when a database retrieval is started and when it is completed:

dw_1.SetTransObject(SQLCA)
 
TraceUser(100, "Starting database retrieval")
IF dw_1.Retrieve() = -1 THEN
      TraceError(999, "Retrieve for dw_1 failed")
ELSE
      TraceUser(200, "Database retrieval complete")
END IF

See also

TraceEnableActivity

TraceError