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
- bigendianbinaryvalue( -- converts big endian binary data (a byte, word, or longword) into an unsigned number (see Binary Data).
- Binary Data -- Panorama allows a formula or procedure to work with raw binary data.
- binarydatabuild( -- builds a binary value by scanning a database and assembling individual binary values for every record (including unselected records) in the database.
- binarytotext( -- converts binary data into text, optionally using a specified encoding.
- binaryvalue( -- converts binary data (a byte, word, longword, or longlongword) into a number (see Binary Data).
- byte( -- converts a number into a single byte of binary data (see Binary Data).
- bytearray( -- extracts a value from an array of bytes (see [Binary Data]).
- bytepattern( -- converts a byte count to text: 543 Bytes, 543 Kb, 123 Mb, 3.2 Gb
- chunkarray( -- extracts a binary "chunk" from binary data (see Binary Data).
- Colors -- Using colors in Panorama formulas and procedures.
- Data Arrays -- A numbered collection of data values.
- Data Dictionaries -- Overview of Panorama's key/value data dictionaries.
- databaseexportjson -- exports selected records in the current database in JSON format to a text file.
- exportjson -- exports the current database in JSON format.
- hex( -- converts a text item containing a hexadecimal number into a standard number (decimal).
- hexbyte( -- converts a limited range of decimal numbers to a two-digit hexadecimal number expressed as a text string.
- hexlong( -- converts a decimal number to an eight-digit hexadecimal number expressed as a text string
- hexstr( -- converts a number to text formatted as a hexadecimal number.
- hextobinary( -- converts a sequence of hexadecimal digits into a raw binary data value.
- hexword( -- converts a decimal number to a four-digit hexadecimal number expressed as a text string.
- importjson -- imports a JSON array into the current database.
- importjsonline -- imports a JSON record into the current record.
- jsonexport( -- converts a Panorama dictionary or data array into JSON.
- jsonexportline( -- exports the current database record in JSON format.
- jsonimport( -- converts JSON into a Panorama dictionary or data array.
- jsonscriptstring( -- converts text into a JSON string literal
- littleendianbinaryvalue( -- converts little endian binary data (a byte, word, longword, or longlongword) into an unsigned number (see Binary Data).
- longlongword( -- converts a number into a 64 bit longword (8 bytes) of binary data (see Binary Data).
- longlongwordarray( -- extracts a value from an array of 64 bit longlongwords (see [Binary Data]).
- longword( -- converts a number into a 32 bit longword (4 bytes) of binary data (see Binary Data).
- longwordarray( -- extracts a value from an array of 32 bit longwords (see [Binary Data]).
- newdatabasewithjson -- creates a new database using a JSON file.
- radix( -- converts a text item containing a number in a radix between 2 and 36 into a decimal number.
- radixstr( -- converts a number into a text item containing the equivalent number in a radix between 2 and 36.
- signedbinaryvalue( -- converts binary data (a byte, word, longword, or longlongword) into a signed number (see Binary Data).
- texttobinary( -- converts text into binary data, optionally using a specified encoding.
- tsvtojson( -- converts tab separated text into JSON formatted text.
- word( -- converts a number into a single word (2 bytes) of binary data (see Binary Data).
- wordarray( -- extracts a value from an array of 16 bit words (see Binary Data).
History
10.2.2 | New | New in this version. |