1. set tSC=...
do $SYSTEM.Status.DisplayError(tSC)
2. set tSC=...
zwrite tSC
3. An alternative?Is there a meaningful difference between the two? Should one be used over the other for any reason? Should something else be used?
1. set tSC=...
do $SYSTEM.Status.DisplayError(tSC)
2. set tSC=...
zwrite tSC
3. An alternative?Is there a meaningful difference between the two? Should one be used over the other for any reason? Should something else be used?
tSC is mostly a %Status object
with enough experience Zwrite tells you all you want and need to know
$SYSTEM.Status.DisplayError(tSC) is easier read. a matter of comfort
@Joseph Griffen
ZWrite is going to output the internal format of the %Status value, which isn't that easy to parse visually. $SYSTEM.Status.DisplayError() will output the status text to the current device in a more readable format.
USER>Write##class(%Atelier.v1.Utils.General).ValidateDocName("project.prj",.sc)
0
USER>ZWrite sc
sc="0 "_$lb($lb(16006,"project.prj",,,,,,,,$lb(,"USER",$lb("e^ValidateDocName+33^%apiSRC^2","e^ValidateDocName+1^%Atelier.v1.Utils.General.1^1","e^^^0"))))/* ERROR #16006: Document 'project.prj' name is invalid [ValidateDocName+33^%apiSRC:USER] */
USER>Do$SYSTEM.Status.DisplayError(sc)
ERROR #16006: Document 'project.prj' name is invalid [ValidateDocName+33^%apiSRC:USER]If you need to store the status text in a variable you can use $SYSTEM.Status.GetErrorText().