Hi Varun,
I thought a array can never be empty only if you declare it as
dim myarray() as array
But then it is almost useless.
But mostly you can see if there are no items in an array with
if myarray.length = 0
In the above example this wil throw an error
If you have declared it as
dim myarray() as array = {} than it had given the result you want.
In the first situation, you could have done
If myarray Is Nothing because there was no array.
But in my opinion is with this type of arrays this is useless coding,
because you know the length of the array.
So look what type of array you use and when you want it dynamical, have a
look for "arraylist".
I hope this helps,
can anyone tell me how i can find out if an array is empty?
i want to code an if statment that loops through an array only if it is
not empty.
I have been trying
if not (CarArray1 is nothing) then
but this doesnt work. I was told to use the count, but it doesnt like my
coding if CarArray1.count >0 then
Can anyone advise me?
Also, How do i clear the items in an array?
CarArray1.clear ????
As u can see i just guessing the coding :o)
thank u