How to determine if a variable contains binary data?

If I extract an element from a data array (a binary entity whose elements can be of any data type), how do I determine whether or not a particular element is binary?

It’s lots of fun answering your own questions - the respondent is always so polite.

I guess I use the datatype( function.

You could also use the expressiontype( function. This allows you to test the data type directly, without having to put it in a field or variable first.