Hi Rory,
Thanks for the reply..
...vbNull is a constant with value 1 - it is not any kind of null/nullable....
Thanks for clearing that up. It was looking as though that was what it was.. but I could not google anything to clarify that. So I can ignore it in consideration of Null / Nothing Empty stuff. Saves me looking further.
_....
Empty is a Variant subtype. If you use = Empty, the compiler will have to create a variable of the relevant type and then perform the comparison. (the appropriate test for a variant is IsEmpty)...
I see now I was doing something a bit stupid. As you said, =
Empty was making a relevant type for the comparison. So I am fooling myself a bit using it as a check for the relevant type of “Null”, “Not there”, “or “what the Not nothing Not there where wotever” .
And I just saw that doing the
If IsEmpty(
________)
____
On a Variable type other than a
Variant which is vbNullString, = “”, 0 or whatever, does not indeed give me
True
But if speed was not too important it could still be a possibility, for the case of my
Variant Variables.
But the better thing to do would be ( for the
Variant Variable case ) to empty them with
=
Empty,
Then do any comparison with
If IsEmpty(
____)
So there still may be some worth in doing some comparison speed tests, but probably again splitting hairs a bit.
The comparison i guess would then be what is quicker. ( For the variant
Variable case )
_A)
Put
=
Empty
Do
If IsEmpty(
____)
_B)
Put
=
Empty
Do
= vbNullString ( or one of the other
Null”, “Not there”, “or “what the Not nothing Not there wotever” )
Do
If _______ = vbNullString ( or the appropriate other “of the other Null”, “Not there”, “or “what the Not nothing Not there wotever” )
Thanks
Alan
P.s. BTW Do you ( or anyone ) happen to know the answer to that?. I guess A) should be quicker than B).
I will have a go sometime anyway when I get the time.