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> CommandsThe following example starts the Add routine, which has a formal parameter list, but passesno parameters. In this case, the Add routine must include code to assign default values to itsformal parameters, since they receive no values from the calling routine.JOB ^Add()The following example creates a process running your current routine at label AA. The processparameters pass your current symbol table to the routine. If running on OpenVMS or UNIXit can use a JOB Server.JOB AA:("":1)The following OpenVMS command creates a process running the ^REPORT routine inimplied namespace, the directory [USER.TEST]. An implied namespace is a directory pathor OpenVMS file specification preceded by two caret characters: "^^dir". Because ^REPORTdoes not require input from the principal device, the null device is specified as principal input.The file report.L is the principal output device.JOB ^REPORT:("^^[USER.TEST]"::"NL:":"report.L")This following command passes the routine parameters VAL1 and the string "DR." to theroutine ^PROG, starting at entry point ABC, in the current namespace. The routine expectstwo arguments. <strong>Caché</strong> does not pass the current symbol table to this job, it will use a JOBServer if possible, and use tta5: as principal input and output device.JOB ABC^PROG(VAL1,"DR."):(:0:"tta5:")The following examples show the jobbing of a class method, with a timeout of ten seconds.They use tta5: as principal input and output device.JOB ##class(MyClass).New():(:0:"tta5:"):10JOB $ZOBJCLASSMETHOD(MyClass,New):(:0:"tta5:"):10Notes<strong>Caché</strong> Assigns Job Numbers and Memory PartitionsAfter you start a jobbed process, <strong>Caché</strong> allocates a separate memory partition for it and assignsit a unique job number (also referred to as a Process ID or PID). The job number is stored inthe $JOB special variable. The status of the job (including whether or not it was started bya JOB command) is stored in the $ZJOB special variable.Since jobbed processes have separate memory partitions, they do not share a common localvariable environment with the process that created them or with each other. When you start64 <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!