Jump to content
xisto Community
Sign in to follow this  
jedipi

[visual Basic] How To Confirm A Array Is Null

Recommended Posts

for example,Dim array() as integerduring run time, how to confirm a array is null (do not contain any element)Thanks

Share this post


Link to post
Share on other sites

Uh... Are you asking a question or is this like a tutorial? If it is a question, please use the "How do I confirm" or "How is an array confirmed" form, or simply add a question mark. I'm not trying to mock you...

Share this post


Link to post
Share on other sites
on error goto wDim a() As IntegerDim i As Integeri = UBound(a)    'If a() contains no element an error will occurexit subw:    msgbox "Array is empty!"

Share this post


Link to post
Share on other sites

If the array is completely empty and thus null, you could just use the IsNull function, like so or IsEmpty():If Isnull(array) then msgbox "array is empty"orIf IsEmpty(array) then msgbox "array is empty"

Share this post


Link to post
Share on other sites

If the array is completely empty and thus null, you could just use the IsNull function, like so or IsEmpty():

If Isnull(array) then msgbox "array is empty"

or

If IsEmpty(array) then msgbox "array is empty"

<{POST_SNAPBACK}>


Thanks for your help.

 

yes..I just use IsEmpty() function to get the task done.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.