11.07.2015 Views

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Caché</strong> <strong>ObjectScript</strong> Special VariablesExamples of errors:WRITE x *xWRITE abc(2) *abc(2)WRITE ^xyz(1,1) ^xyz(1,1)WRITE ^|"samples"|xyz(1,2) ^xyz(1,2)WRITE ^||ppg(1) ^||ppg(1)WRITE ^|"^"|ppg(2) ^||ppg(2)// undefined local variable// undefined subscripted local variable// undefined global// undefined global with namespace specification// undefined process-private global// undefined process-private globalExample of a error:SET $ZUTIL(68,1,0)WRITE ^abc("") ^abc("")Examples of errors:DO ^NotThere *NotThereJOB ^NotThere *NotThereGOTO ^NotThere *NotThereExamples of object errors:WRITE $SYSTEM.XXQL.MyMethod() *%SYSTEM.XXQLWRITE $SYSTEM.SQL.MyMethod() *MyMethod,%SYSTEM.SQL *SomeProp,Package.ClassnameExample of a error:SET ^a="fruit"SET ^a(1)="apple"SET x=$ZUTIL(68,28,1) // disable global root node killsKILL ^a(1)KILL ^a// attempting to kill a global root node ^a,c:\cachesys\mgr\userPre-5.1 Error Handling CodeA consequence of adding an info component to these error codes is that pre-5.1 error handlingroutines that made assumptions about the format of the string in $ZERROR may requireredesign to work as before. For example, the following will no longer work in version 5.1:WRITE "Error line: ", $PIECE($ZERROR, ">", 2)and should be changed to be something like:WRITE "Error line: ", $PIECE($PIECE($ZERROR, ">", 2), " ", 1)472 <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!