How to compare a binary data with Byte array with no elements?

How to compare a binary data with Byte array with no elements?

  
Hi,

I try to compare a variable of type binary data with a variable of type binary data initialized with default value but the comparison fails.

Example :

Variable ByteArrayWithValues assign with something.
Variable ByteArrayWithZeros assign with default value

if (ByteArrayWithValues = ByteArrayWithZeros)

The error is : Invalid Data Type - Incompatible data types in eq operator ('BinaryData',' BinaryData').

How i do something like this?

Cheers,
Rui Dias
Hi Rui.
You cannot compare two binary data variables right from Service Studio. You would have to write an extension for that, if that's really necessary for your project.

But you might have a look into the BinaryData extension published in the solutions directory:
http://www.outsystems.com/NetworkSolutions/ProjectDetail.aspx?ProjectId=69

You can check if a variable is empty by using the BinaryDataSize action. It returns the number of bytes of the variable.

Hope this helps,
Leonardo Fernandes
Hi Leonardo Fernandes.

Problem resolved.

Thank you ;)

Cheers,
Rui Dias