Hello experts!
Is there a way to check if a variable of data type Variant is uninitialised?
At least there seams to be a value that is interpreted by navision as uninitialised. If I use an uninitialised variant as a sourcexpression for a textbox the textbox will display the text "<uninitialised>".
I want to be able to check this in code. For automation data type I can use ISCLEAR but that doesn't work for variants.
Any ideas?
0
Comments
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Perhaps there is a way of catching the error so it is not displayed and execution is not stoped.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
var1 type variant
var2 type variant
ok type boolean
Function:
EDIT:
You could always check to see if the type of text, allow that to be zero length by checking the pvariant.ISTEXT beforehand since you may allow that blank... just an idea
"Profanity is the one language all programmers know best."
"Profanity is the one language all programmers know best."
But determining if variant is empty by string length it contains is not quite acurate.. The variant might be initialised, and containing an empty string - but this function would treat that variant as being empty(uninitialised)...