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.

USENote:Sequential file seeking with the USE command, such as that shown in the aboveexample, is not supported on OpenVMS systems.NotesDevice OwnershipDevice ownership is established with the OPEN command. The only exception is the principaldevice, which is assigned to the process and is usually the terminal at which you sign on. Ifthe device specified in the USE command is not owned by the process, <strong>Caché</strong> issues a error message.The Current DeviceThe current device is the device used for I/O operations by the READ and WRITE commands.The READ command acquires input from the current device and the WRITE commandsends output to the current device.<strong>Caché</strong> maintains the ID of the current device in the $IO special variable. If the USE requestis successful, <strong>Caché</strong> sets $IO to the ID of the specified device. The $ZUTIL(96,14) functionreturns the device type of the current device.The Principal DeviceThe special device number 0 (zero) refers to the principal device. Each process has oneprincipal device. <strong>Caché</strong> maintains the ID of the principal device in the $PRINCIPAL specialvariable. The principal device is automatically opened when you start up <strong>Caché</strong>. Initially, theprincipal device ($PRINCIPAL) and the current device ($IO) are the same.After you issue a USE command, your current device ($IO) is normally the one named inthe last USE command you executed.While many processes can have the same principal device, only one at a time can own it.After a process successfully issues an OPEN command for a device, no other process canissue OPEN for that device until the first process releases it, either by explicitly issuing aCLOSE command, by halting, or because that user ends the session.Although you can issue OPEN and USE for a device other than your principal device fromthe programmer prompt, each time <strong>Caché</strong> returns to the > prompt, it implicitly issues USE0. To continue using a device other than 0, you must issue a USE command in each line youenter at the > prompt.Your principal device automatically becomes your current device when you do any of thefollowing:<strong>Caché</strong> <strong>ObjectScript</strong> <strong>Reference</strong> 149

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

Saved successfully!

Ooh no, something went wrong!