|
-
Dec 12th, 2002, 09:46 AM
#1
Thread Starter
Fanatic Member
Checking if somethng is Nothing
Hi
How can i check to see if an UDT array is nothing?
Thanks
-
Dec 12th, 2002, 09:54 AM
#2
Fanatic Member
Dim lTemp as long
On Error Resume Next
lTemp = LBound(MyUDTArrray)
If Err.Number <> 0 Then
msgbox "MyUDTArray has not been dimensioned!"
end if
On Error Goto 0
Leather Face is comin...
MCSD
-
Dec 12th, 2002, 09:57 AM
#3
Thread Starter
Fanatic Member
Thanks for your reply, but anyone know another way?
Im sure theres a way you can do it like
If UDTarray = nothing or similar
-
Dec 12th, 2002, 10:14 AM
#4
Addicted Member
Well, with objects you can do
VB Code:
if theObject is nothing then
'do whatever
end if
I'm pretty sure that won't work with UDT's though
Computer /nm./: a device designed to speed and automate errors
-
Dec 12th, 2002, 10:37 AM
#5
Checking for an error in one way or another is the only way it can be done. "Nothing" can only be used with objects.
-
Dec 12th, 2002, 10:40 AM
#6
Fanatic Member
-
Dec 13th, 2002, 07:42 AM
#7
Thread Starter
Fanatic Member
Thanks for your replies, i understand arrays are not objects, its just that when an array is not dimensioned, vb (in a tooltip) pops up the word 'nothing' when my mouse if hovered over the array, so i just thought maybe you could check it like you could with objects.
Ohwell, the On error will do fine, just i didnt want to do that if there was a simpler way
Thanks
-
Dec 13th, 2002, 10:48 AM
#8
Addicted Member
VB Code:
If IsArray([i]MyArray[/i]) Then ...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|