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.

Routine, Debugging, and Other CommandsDescriptionZINSERT "code" inserts a specified line of <strong>Caché</strong> <strong>ObjectScript</strong> code in the current routineat the current line location (edit pointer), as established by the ZPRINT or ZREMOVEcommand, by a previous ZINSERT command, or by some forms of the $TEXT function.ZINSERT "code":location inserts the specified line of code in the current routine after thespecified line location. Line location can be specified as number of lines offset from thebeginning of the routine, or number of lines offset from a specified label.After ZINSERT inserts a line of code, it resets the edit pointer to the end of this new line ofcode. This means the next ZINSERT places its line of code directly after the last new line,unless it explicitly specifies a location.ZINSERT effects only the local copy of the routine. It does not change the routine as storedon disk. To store inserted lines, you must use the ZSAVE command to save the routine.ZINSERT incrementally compiles each line.The ZINSERT command is usually executed from the programmer prompt. It should not becoded into the body of a routine, because its operation would effect the execution of thatroutine. To call ZINSERT from a routine, use the XECUTE command.CAUTION:ZINSERT and other commands move the edit pointer.ArgumentspcAn optional postconditional expression. <strong>Caché</strong> executes the command if the postconditionalexpression is true (evaluates to a non-zero numeric value). <strong>Caché</strong> does not execute the commandif the postconditional expression is false (evaluates to zero). For further details, referto Command Postconditional Expressions in Using <strong>Caché</strong> <strong>ObjectScript</strong>.codeA line of <strong>Caché</strong> <strong>ObjectScript</strong> code, specified as a string literal (in quotes), or a variable thatcontains a string literal. This line of code can contain one or more <strong>Caché</strong> <strong>ObjectScript</strong> commands,a new label name, or both a label and one or more commands. Because the code isinserted into a routine, it must follow <strong>Caché</strong> <strong>ObjectScript</strong> formatting. Therefore, the firstcharacter of the code string literal must either be a blank space (standard <strong>Caché</strong> <strong>ObjectScript</strong>indentation) or a label. The enclosing quotation marks are required. Since quotation marksenclose the line of code you are inserting, quotes within the code itself must be doubled.390 <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!