contents of arrays

Hey all,

I'm trying to write this stupid little program in .net and I don't know how to check if an array has contents in it (d'oh!).
I don't need to know 'what' is in the array, just if there is anything in it.
Anybody out there willing to help? Thanks in advance...

[size=5][red]dodge[/red]

Comments

  • : Hey all,
    :
    : I'm trying to write this stupid little program in .net and I don't know how to check if an array has contents in it (d'oh!).
    : I don't need to know 'what' is in the array, just if there is anything in it.
    : Anybody out there willing to help? Thanks in advance...
    :
    : [size=5][red]dodge[/red]
    : -----------------------------------------------------------
    Dear Dodge,

    My Reply: I give below a simple example:
    Dim Myary(5) as String
    Myary(3) = " r23"
    Dim bytfound as Byte = 0
    Dim intI as Integer = 0
    'Now to check the contents of Myary, you can do the following:

    For intI = 0 to Myary.Length - 1

    if Myary(intI).Trim <> "" then
    bytfound = 1
    exit For
    end if

    next intI

    if bytFound > 0
    MessageBox.Show("Yes, there are contents in the array")
    end if

    With Warm Regards,

    Dilip Nagle

  • : Hey all,
    :
    : I'm trying to write this stupid little program in .net and I don't know how to check if an array has contents in it (d'oh!).
    : I don't need to know 'what' is in the array, just if there is anything in it.
    : Anybody out there willing to help? Thanks in advance...
    :
    : [size=5][red]dodge[/red]
    :

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion