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.

Most magnetic tape programs need not be concerned with $ZB unless they must deal withunusual formats and variable length blocks.To monitor magnetic tape operations, your program can test the appropriate bit of $ZA aftereach read and write.The following code checks both $ZA and $ZB after each magnetic tape read, and sets MTERRwhen either of these variables indicates an error. It also sets $ZTRAP when a magnetic tapeerror occurs.; $$MTIN(mtdev) = the next logical record from magtape; device mtdev.; Also returns za=$ZA and zb=$ZB; On a magtape error, mterr=1 and $$MTIN(mtdev)=""; Expects the caller to have set $ZT to trap other; errors.MTIN(io)NEW rec,curdevSET mterr=0,curdev=$IO,$ZT="MTIERR"USE ioREAD recMTIEXITSET za=$ZA,zb=$ZBUSE curdevQUIT recMTIERRIF $ZERROR["MAGTAPE" {USE curdevZQUIT 1GOTO @$ZTRAP }; Use caller's error trap.ELSE {SET $ZTRAP="",mterr=1,rec=""GOTO MTIEXIT }If a terminator completes a READ, <strong>Caché</strong> mode returns the terminator as a string in $ZB.If an escape sequence terminates a READ, <strong>Caché</strong> mode returns the ASCII escape sequenceas a string in $ZB.See Also• READ command• WRITE command• $KEY special variable• $ZA special variable• $ZEOF special variable• I/O Devices and Commands in <strong>Caché</strong> I/O Device Guide• Terminal I/O in <strong>Caché</strong> I/O Device Guide$ZB<strong>Caché</strong> <strong>ObjectScript</strong> <strong>Reference</strong> 465

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

Saved successfully!

Ooh no, something went wrong!