TraceUser PowerScript function
Description
Logs the activity type value you specify to the trace file.
Syntax
|
1 |
<span>TraceUser</span> (<span>info</span>, <span>message </span>) |
|
Argument |
Description |
|---|---|
|
info |
A long whose value is a reference number |
|
message |
A string whose value is the activity |
Return Values
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:
|
1 |
dw_1.SetTransObject(SQLCA) |
|
1 |
|
1 |
<span>TraceUser</span>(100, "Starting database retrieval") |
|
1 |
IF dw_1.Retrieve() = -1 THEN |
|
1 |
TraceError(999, "Retrieve for dw_1 failed") |
|
1 |
ELSE |
|
1 |
<span> TraceUser</span>(200, "Database retrieval complete") |
|
1 |
END IF |