Errorhandling functions




uError

Description

Writes error text into a log file and breaks from the current function or programming context. The function returns the message written.

Syntax

string uError(errortext)

Parameters

string errortext

Text to write to log file.

Examples

Example 1

To signal an error:

uError("'PP' is no valid country key.")  



uErrortext

Description

Returns the last error message. The error text will be internally cleared, so it can only be read once.

Syntax

string uErrortext() 

Examples

Example 1

To retrieve the last errortext:

uErrortext() // returns last error text



uInfo

Description

Writes an informal message into the log file. The function returns the message written.

Syntax

string uInfo(infotext)

Parameters

string infotext

Text to write to log file.

Examples

Example 1

To log an informal message:

uInfo("21445 records selected.") 



uWarning

Description

Writes a warning message into the log. The function returns the message written.

Syntax

string uWarning(warningtext);
string errortext;

Parameters

string warningtext

Text to write to log file.

Examples

Example 1

To log a warning message:

uWarning("The attribute for the customer name is null.")  



uTrace

Description

Writes a trace message into the log. The function returns the message written.

Syntax

string uTrace(tracetext)

Parameters

string tracetext

Text to write to log file.

Examples

Example 1

To log a trace message:

uTrace("CUSTOMER_NAME = " + CUSTOMER_NAME)  



uTracelevel

Description

Sets the detail level of trace messages in the log. The range of tracelevel is from 0 (no trace) to 5 (very verbose).

NoteHeavy logging dramatically slows down performance.

Syntax

uTracelevel(tracelevel)

Parameters

integer tracelevel

Specifies the verbosity of trace messages (0=off, 5=very verbose).

Examples

Example 1

To set the trace level:

uTracelevel(5)  // sets the tracelevel to 'very verbose'