As i know it, there is not such a check.
It would sometimes be handy to have something like VariantVar.HASVALUE, similar to VariantVar.ISTEXT OR VariantVar.ISBOOLEAN…
You can’t use COMPRESSARRAY either.
Maybe you can start out by assigning a dummy value to all dimensions in the array, and then check if the value is different from that dummy value.
Or if you know that it can only contain a given type of value (say it can only be assigned a text value) you could maybe use VariantVar.ISTEXT, as this one would return false if nothing has been put in the dimension at all, and true if a text value has been assigned.
I’ve actually found a much better way to check this.
There is a function called ISCLEAR. In the documentation it says it’s for checking if a AUTOMATION variable is cleared or not. But it also works fine with VARIANT variables, at least in NAV 5.0 SP1!
Neither EVALUATE nor ISCLEAR actually worked in production, despite my initial tests showed that it worked.
Instead Rashed’s suggestion actually brought me in the right direction:
The soluton was creating a “simple” function like this:
IsVarEmpty(VAR VariantVar : Variant) : Boolean
EXIT(NOT (
VariantVar.ISCODE OR
VariantVar.ISTEXT OR
VariantVar.ISINTEGER OR
VariantVar.ISDECIMAL OR
VariantVar.ISBOOLEAN OR
VariantVar.ISOPTION OR
VariantVar.ISCHAR OR
VariantVar.ISDATE OR
VariantVar.ISTIME));