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.

ZINSERTlocationThe line after which ZINSERT will insert the code. It can take either of the following forms:+offsetlabel+offsetSpecifies a line number within the routine. (The plus sign isrequired.)Specifies a label and a line number within the labelled section.Note:Specifying label^routine for the location generates a error.Lines of code are numbered beginning with 1. Thus a location of +1 inserts a line of codeafter the first line of the routine. To insert a line at the start of the routine or the start of alabelled section (before the existing first line), use an offset of +0. For example:ZINSERT "Altstart SET c=12,d=8":+0inserts the code line at the start of the routine.If location is omitted, the code is inserted at the current line location (edit pointer).ExamplesThe following example inserts the code line SET x=24 after the fourth line within the currentroutine. Because this inserted code line does not begin with a label, an initial space must beincluded as the required line start character.ZINSERT " SET x=24":+4In the following example, assume that the currently loaded routine contains a label called"Checktest". The ZINSERT command inserts a new line after the sixth line within Checktest(Checktest+6). This new line contains the label "Altcheck" and the command SET y=12.ZINSERT "Altcheck SET y=12":Checktest+6Note that because the inserted code line begins with the label “Altcheck”, no initial space isrequired after the quotation mark.The following example inserts the code line SET x=24 WRITE !,"x is set to ",x afterthe fourth line within the current routine. Because an inserted code line is enclosed in quotationmarks, the quotation marks in the WRITE command must be doubled.ZINSERT " SET x=24 WRITE !,""x is set to "",x":+4<strong>Caché</strong> <strong>ObjectScript</strong> <strong>Reference</strong> 391

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

Saved successfully!

Ooh no, something went wrong!