JenniferMurphy
Well-known Member
- Joined
- Jul 23, 2011
- Messages
- 2,691
- Office Version
- 365
- Platform
- Windows
Is the null (0 length) string ("") the same as Empty or not? The Immediate window seems confused or ambivalent:
It appears that Null is different than anything else:
I am interested in this because I want to choose a value to return from a Variant subfunction that cannot be confused with any other value. It looks like Null is that value.
Comments?
Code:
?"" = empty
True
?isempty("")
False
xblank = ""
?xblank = empty
True
?isempty(xblank)
False
It appears that Null is different than anything else:
Code:
?null=empty
Null
?null=""
Null
?null=null
Null
?isnull(null)
True
xnull = null
?xnull = null
Null
?isnull(xnull)
True
I am interested in this because I want to choose a value to return from a Variant subfunction that cannot be confused with any other value. It looks like Null is that value.
Code:
Private function Test(. . .)
. . .
'Do some work. If the result fails some test, let the caller know by returning a Null result
If (some test) then Test = Null: Exit Function
. . .
End Function
Comments?