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.

NEWNote:Exclusive NEW (NEW (x,y,z)) temporarily removes local variables from the currentscope. This can affect local variables created by <strong>Caché</strong> objects. For example, <strong>Caché</strong>maintains %objcn which is the cursor pointer for <strong>Caché</strong> Objects queries. Removingthis from the current scope can result in collisions with other internal structures.Therefore, do not use exclusive NEW in any context where it might affect systemstructures.NEW RestrictionsThe NEW command cannot be used on the following:• Globals• Process-Private Globals• Local variable subscripts• Private variables• Special variables, with the exception of $ETRAPAttempting to use NEW in any of these contexts results in a error.ArgumentspcAn optional postconditional expression. <strong>Caché</strong> executes the NEW command if the postconditionalexpression is true (evaluates to a non-zero numeric value). <strong>Caché</strong> does not executethe command if the postconditional expression is false (evaluates to zero). For further details,refer to Command Postconditional Expressions in Using <strong>Caché</strong> <strong>ObjectScript</strong>.variableName of a single variable or a comma-separated list of variable names. You can specify onlyunsubscripted variable names, although you can NEW an entire array (that is, an array namewithout subscripts). You can specify undefined variable names or you can reuse the namesof existing local variables. For an inclusive NEW, when you specify an existing local variable,<strong>Caché</strong> reinitializes that variable in the local environment, but saves its current value on theprogram stack and restores it after the subroutine or function terminates.When a variable name or comma-separated list of variable names is enclosed in parentheses(exclusive NEW), <strong>Caché</strong> performs the opposite operation. That is, all local variables arereinitialized except the specified variable names, which retain their previous values. <strong>Caché</strong><strong>Caché</strong> <strong>ObjectScript</strong> <strong>Reference</strong> 95

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

Saved successfully!

Ooh no, something went wrong!