11.07.2015 Views

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Caché</strong> <strong>ObjectScript</strong> Special VariablesYour error handlers can check for a particular string value you choose and take steps tohandle the particular condition appropriately.$ECODE String OverflowIf the length of the accumulated string in $ECODE exceeds 512 characters, the first newerror code that causes the string overflow replaces the current list of error codes in $ECODE.See Using <strong>Caché</strong> <strong>ObjectScript</strong> for more information about the maximum string data length.NotesCreating Your Own Error CodesThe format for the $ECODE special variable is a comma-surrounded list of one or moreerror codes. Error codes starting with the letter U are reserved for the user. All other errorcodes are reserved for <strong>Caché</strong>Non-null values that you use to set $ECODE should be distinguishable from the values <strong>Caché</strong>automatically generates. To ensure this, always prefix your error text with the letter U. Alsoremember to delineate your error code with commas. For example:SET $ECODE=",Upassword expired!,"WRITE !,"ECODE set to: ",$ECODESET $ECODE=""WRITE !,"ECODE cleared: ",$ECODECheck $ZERROR Rather Than $ECODE for <strong>Caché</strong> ErrorsYour error handlers should check $ZERROR rather than $ECODE for the most recent <strong>Caché</strong>error.See Also• ZTRAP command• $STACK function• $ESTACK special variable• $ZEOF special variable• $ZERROR special variable• $ZTRAP special variable• Error Handling in Using <strong>Caché</strong> <strong>ObjectScript</strong>• System Error Messages in <strong>Caché</strong> Error <strong>Reference</strong>422 <strong>Caché</strong> <strong>ObjectScript</strong> <strong>Reference</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!