|
-
Oct 10th, 2001, 08:30 PM
#1
Thread Starter
New Member
Array within an array
Hello,
I have an array within an array and I want to determine if the entire array is empty or not. For example
Array(0) is Empty
Array(1)(0) has something
Array(1)(1) has something
Array(2) is Empty
How do I loop through the entire array and what condition should I use in my "if statement" to determine if it is empty? Thanks.
-
Oct 10th, 2001, 09:00 PM
#2
Member
VB Code:
If VariableToTestOrArrayElementToTest Is Emtpy Then
' or
If VariableToTestOrArrayElementToTest = Empty Then
I think one of those works...
-
Oct 10th, 2001, 10:07 PM
#3
Thread Starter
New Member
An error comes up everytime I try that cause I think the compiler (or whatever) can't traverse the inner arrays with an "if empty" statement. For example:
Using this if statement:
For i = LBound to UBound
if Array(i) = Empty Then
Do something
end if
Next i
The following array will work:
array(0) - Empty
array(1) - Empty
array(2) - Empty
The following array will NOT work:
array(0) - Empty
array(1)(0) - Something
array(1)(1) - Something
array(2) - Empty
An error will occur if array(1)(0) is read into the if statement. Does anyone know how to solve this? Thanks.
-
Oct 10th, 2001, 10:29 PM
#4
Frenzied Member
Perhaps...a 2 dimensional array?
You just proved that sig advertisements work.
-
Oct 19th, 2001, 07:36 AM
#5
Frenzied Member
Originally posted by filburt1
VB Code:
If VariableToTestOrArrayElementToTest Is Emtpy Then
' or
If VariableToTestOrArrayElementToTest = Empty Then
I think one of those works...
it's
if isEmpty(VariableToTestOrArrayElementToTest )
but it will not work for array
-
Oct 19th, 2001, 09:17 AM
#6
Actually you cannot have arrays within array in VB. M$ has added this feature in VB.NET though.
Your only workaround is 2 (or more) dimmensional array.
-
Oct 19th, 2001, 09:34 AM
#7
Addicted Member
Strange
Serge,
I have done this in my application and it seems to work fine. Is there something I have overlooked.
Cheers,
Steve
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
|