1
Views
2
Comments
How to compare a binary data with Byte array with no elements?
Question
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
2019-07-08 11-04-35
Leonardo Fernandes
 
MVP
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:
https://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
UserImage.jpg
Rui Dias
Hi Leonardo Fernandes.

Problem resolved.

Thank you ;)

Cheers,
Rui Dias
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.