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.

ZZDUMP0000: 37 70000: 2B 30 30 37 +007Examples of List ElementsThe following examples show ZZDUMP returning hex dumps for lists created using$LISTBUILD.The following example shows two lists, the first with a single item, the second with threeitems. Note that each list item has its own length and datatype, and that these two bytes arerepresented both in the length count and as dots (non-printing characters) in the printdata onthe right side of each line. The datatype code for a string is 01.SET x=$LISTBUILD("ABC")SET y=$LISTBUILD("A","B","C")ZZDUMP x,y0000: 05 01 41 42 43 ..ABC0000: 03 01 41 03 01 42 03 01 43 ..A..B..CThe following example shows a list element that do not contain a value. Note how an undefinedlist differs from the null string list. An undefined list has a length of 01 (the length byte itself)and no datatype or value. A null string list has a length of 02 (the length byte and the datatypebyte) and has a datatype of 01 (string).ZZDUMP $LISTBUILD() // 01 .ZZDUMP $LISTBUILD("") // 02 01 ..The following example shows two lists that contain different forms of the number 65. In thefirst case, ZZDUMP treats “65” as a two-character string and returns the hexadecimal valuefor each character. In the second case, ZZDUMP treats 65 as a decimal number and returnsthe equivalent hexadecimal number (41) and the corresponding ASCII character (“A”) , inthe printdata on the right side of the dump line.ZZDUMP $LISTBUILD("65") // 04 01 36 35 ..65ZZDUMP $LISTBUILD(65) // 03 04 41 ..AThe following example shows lists with different datatype values. The comments for eachline show the length and datatype values returned:ZZDUMP $LISTBUILD("A") // 03 01ZZDUMP $LISTBUILD($CHAR(960)) // 04 02ZZDUMP $LISTBUILD(7) // 03 04ZZDUMP $LISTBUILD(-7) // 03 05ZZDUMP $LISTBUILD($ZPI) // 0B 06ZZDUMP $LISTBUILD(-$ZPI) // 0B 07ZZDUMP $LISTBUILD($DOUBLE($ZPI)) // 0A 08ZZDUMP $LISTBUILD($DOUBLE(-$ZPI)) // 0A 08ZZDUMP $LISTBUILD(-$DOUBLE($ZPI)) // 0A 08<strong>Caché</strong> <strong>ObjectScript</strong> <strong>Reference</strong> 417

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

Saved successfully!

Ooh no, something went wrong!