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.

$DATAStatusValue011011MeaningThe variable is undefined. Any reference would cause an error.The variable exists and contains data, but has no descendants. Note thatthe null string ("") qualifies as data.The variable identifies an array element that has descendants (contains adownward pointer to another array element) but does not contain data. Anydirect reference to such a variable will result in an error.For example, if $DATA(y) returns 10, set x=y will produce an error.The variable identifies an array element that has descendants (contains adownward pointer to another array element) and contains data. Variablesof this type can be referenced in expressions.Note:Status values 1 and 11 indicate only the presence of data, not the type of data.For more information on errors, refer to the $ZERROR special variable.ParametersvariableThe variable can be a local variable, a process-private global, or a global. It can be a subscriptedarray element within a variable, process-private global, or global. If a global variable,it can include an extended global reference. If a subscripted global variable, it can be a nakedglobal reference.targetAn optional parameter. Specify the name of a local variable, a process-private global, or aglobal. This target variable does not need to be defined. If target is specified, $DATA writesthe current data value of variable into target. If variable is undefined, the target value remainsunchanged.ExampleThis example writes a selected range of records from the ^client array, a sparse array consistingof three levels. The first level contains the client's name, the second the client's address, andthe third the client's accounts, account numbers, and balances. A client can have up to four<strong>Caché</strong> <strong>ObjectScript</strong> <strong>Reference</strong> 197

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

Saved successfully!

Ooh no, something went wrong!