Appenddataarrays( function malfunction?

This code:

local alpha, beta, gamma
alpha = dataarray("1","2","3","4")
beta = dataarray("5","6","7")
gamma = appenddataarrays(alpha,beta)
message gamma

gives the most intriguing error message I’ve ever seen:

If, instead of a message, I assign the result to the clipboard and paste it elsewhere, I see this:

"bplist00‘ vwX$versionX$objectsY$archiverT$top Ü†Ø $ &’()289:;ABCDJKLMSTUV]^_efghlrsU$null”

[ArrayValues\DefaultValueV$classÄ Ä!Ä#“
ZNS.objectsß Ä Ä Ä
Ä Ä Ä Ä Ä ÷ ¬
!"#$%]TokenStartEndXDataTypeYTokenTextZExpressionUValueÄ Ä Ä Ä ÄS"1"W{95, 3}Q1“+,-Z$classnameX$classes_ TextOperandToken§./01_ TextOperandToken\OperandToken_ ExpressionTokenXNSObject÷ ¬
3!4#6%Ä
Ä Ä Ä
ÄS"2"W{99, 3}Q2÷ ¬
<!=#?%Ä
Ä
Ä Ä ÄS"3"X{103, 3}Q3÷ ¬
E!F#H%Ä Ä Ä Ä ÄS"4"X{107, 3}Q4÷ ¬
N!O#Q%Ä Ä Ä Ä ÄS"5"X{129, 3}Q5÷ ¬
W!X#Z%Ä Ä Ä Ä ÄS"6"X{133, 3}Q6÷ ¬
`!a#c%Ä Ä Ä Ä¬ÄS"7"X{137, 3}Q7“
+ij^NSMutableArray£ik1WNSArray÷ ¬
!"#p%Ä Ä Ä Ä"ÄP“*+tuWPVArray¢t1_ NSKeyedArchiver—xyTrootÄ # - 2 7 ^ d k w Ñ ã ç è ë ñ ° © ´ ≠ Ø ± ≥ µ ∑ π ∆ ‘ › Á Ú ¯ ˙ ¸ ˛ " + > C V c u ~ ã ç è ë ì ï ô ° £ ∞ ≤ ¥ ∂ ∏ ∫ æ « … ÷ ÿ ⁄ ‹ fi ‡ ‰ Ì Ô ¸ ˛
" $ & ( * , 0 9 ; H J L N P R V _ a f u y Å é ê í î ñ ò ô û ¶ © ª æ √ z ≈"

which is basically what’s in the error message. I believe that I’m following the instructions in the Pan Help file but maybe not?

michael

This code works fine

local alpha, beta, gamma alpha = dataarray("1","2","3","4") beta = dataarray("5","6","7") gamma = appenddataarrays(alpha,beta) message arraysize(gamma)

The message is 7. Your message is simply showing you the content of the data array. It’s not an error message.

A data array is binary data, not text. You aren’t supposed to be able to read it in its raw form.

Try using the array( function to extract its 5th element for example. Or use exportdataarray( to convert it to a text array, and put that in your message.

OK, thanks Dave. The documentation of the dataarray( and appenddataarrays( functions says nothing about their being binary. Was that point made in one of the videos? I don’t recall it and my notes don’t mention it.

michael

The point was made in one of the classes. Assuming that class is among the videos, the point would have been made there. I can only assume. I haven’t reviewed the videos to see what is covered there.

Dave

The documentation on dataarray( says

The resulting array can be stored in a variable or in a binary field.

If the field must be a binary field, it follows that it’s binary.

Dave

You’re absolutely right Dave. My bad.

michael

Using exportdataarray( returned the array with carriage returns. How come binarytotext(gamma) returns nothing?

Binarytotext( basically takes text that has been mislabeled as binary data, and changes the label. Optionally, it will do some converting, if you tell it the text was encoded, using a different encoding than the one it wants to use. If no converting was necessary, it will be returning the very same ones and zeroes, but now it will be calling it text.

Binary data could be anything from text, that Panorama doesn’t know yet is text, to an encrypted zip archive of a photograph that was loaded with a fileload(. Some of it can simply be relabeled as text, and you can read it, and some will make no sense at all without help from software that understands it.

Dave