void exception.SetError(string)
Return Type: void
Parameters: string ErrMessage
Description:
SetError sets the state of the exception to an error and defines the
message of the exception as ErrMessage. Errors that are thrown will
exit a script if not processed in a try-catch statement.
A thrown error will increment the script warning counter. See GetErrorCount.
| Example
Code |
exception
err;
err.SetError("User Error");
err.throw();
|
| Output |
| ** ERROR:
(1) from 'Sample.psc' on line 3 - User Error |
See exception
for additional examples.
See Also: exception