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.

ArgumentspcAn optional postconditional expression. <strong>Caché</strong> executes the KILL 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>.variableIf not enclosed in parentheses: the variable(s) to be deleted by the KILL command. variablecan be a single variable or a comma-separated list of variables.If enclosed in parentheses: the local variable(s) to be kept by the KILL command; the KILLcommand deletes all other local variables. variable can be a single variable or a commaseparatedlist of variables.ExamplesIn the following example, an inclusive KILL deletes local variables a, b, and c, and thedeletes the process-private global ^||ppglob and all of its subscripts. No other variables areaffected.SET ^||ppglob(1)="fruit"SET ^||ppglob(1,1)="apples"SET ^||ppglob(1,2)="oranges"SET a=1,b=2,c=3,d=4,e=5KILL a,b,c,^||ppglobWRITE "d=",d,!,"e=",eIn the following example, an exclusive KILL deletes all local variables except for variablesd and e.SET a=1,b=2,c=3,d=4,e=5KILL (d,e)WRITE "d=",d,!,"e=",eNote that because an exclusive KILL deletes object variables, the above program works froma terminal session, but does not work within an object method.The following example, an inclusive KILL deletes two process-private globals and anexclusive KILL deletes all local variables except for variables d and e.SET ^||a="one",^||b="two"SET a=1,b=2,c=3,d=4,e=5KILL ^||a,^||b,(d,e)WRITE "d=",d,!,"e=",eKILL<strong>Caché</strong> <strong>ObjectScript</strong> <strong>Reference</strong> 75

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

Saved successfully!

Ooh no, something went wrong!