[thelist] VB Array

Chris axe at suburbia.com.au
Thu Jul 4 10:41:00 CDT 2002


Thanks for your help Paul.
The IsEmpty and IsNull returned the same result for index values that were
and were not set. :(
On the other hand I think vartype could be getting me somewhere as it
returns 8 (string?) for index values that are set and 9  (object) for those
which are not.

I'm working with winsock controls which I am creating at runtime when
needed, as in:

if sock(CurrentIndex).state <> sckClosed then
	load sock(NextIndex)
	....
end if

And the reason I need to check if a sock(Index) is set is so that I can do
something like:

if isset( sock(Index) ) then
	..do stuff..
	unload sock(Index)
end if

I don't know how reliable using vartype is but it seems to work, so eh...

Thanks again for your help. :)


Regards,
Chris


-----Original Message-----
From: thelist-admin at lists.evolt.org
[mailto:thelist-admin at lists.evolt.org]On Behalf Of Paul Cowan
Sent: Thursday, 4 July 2002 14:41
To: thelist at lists.evolt.org
Subject: Re: [thelist] VB Array



Chris wrote
> How can I programmatically check if MyArray(4) is set?

if IsEmpty(MyArray(4)) then
    ... whatever ...
end if

should do the trick. Or maybe IsNull(). Or look at the vartype()
and typename() functions.

I like to think of myself as a bit of a VB (well... VBScript) whiz
(please, hold your applause), but I still don't get the whole
null vs. nothing vs. empty thing.

But anyway, I think IsEmpty() covers your case.

Paul.

--
For unsubscribe and other options, including
the Tip Harvester and archive of thelist go to:
http://lists.evolt.org Workers of the Web, evolt !




More information about the thelist mailing list