binarydatatype(
DATA
)

The binarydatatype( function returns information about the type of structure data contained in a binary data value, if available (see Binary Data).


Parameters

This function has one parameter:

data – is the binary value that you want to inspect.


Description

This function inspects a binary data value (see Binary Data). It the binary value contains structured data (Array, Dictionary or Color) it returns the type of structured data.

binarydatatype(dataarray("Bob",123,"Green") ☞ Array
binarydatatype(initializedictionary("Color","Red","Size",12) ☞ Dictionary
binarydatatype(htmlrgb("7700FF")) ☞ Color

If the binary value contains a single byte, word (16 bits), long word (32 bits) or long long word (64) bytes the function will return the corresponding data name.

binarydatatype(byte(33)) ☞ Byte
binarydatatype(word(33)) ☞ Word
binarydatatype(byte(33)+byte(86)) ☞ Word
binarydatatype(longword(33)) ☞ Long
binarydatatype(longlongword(33)) ☞ LongLong

If the binary value contains any other length of data, the function simply returns Data. You can use the length( function to find out the actual length of the data.

binarydatatype(byte(33)+byte(86)+byte(23) ☞ Data

As a convenience, this function will also return the type of any other type of data you give to it.

binarydatatype("Hello") ☞ Text
binarydatatype(42) ☞ Integer
binarydatatype(3.14) ☞ Float

Notice that if you pass a Text Array to this function, the returned data type will simply be Text. The function has no way of knowing that you intend to interpret an item of text as a text array, it can only identify Data Arrays.


See Also


History

VersionStatusNotes
10.2.2NewNew in this version.