|
-
Oct 13th, 2000, 02:34 PM
#1
Thread Starter
Junior Member
Hi! There!
OK, My problem is with an TypeUserDefined Array.
How can i know if my array is empty???
for example
i have
MODULE:
Type anyType
a1 as string *2
a2 as string *2
a3 as string *2
a4 as string *2
a5 as string *2
End Type
global arr() as anyType
FORM:
if i do a reference to my Array without set a number of elements it's obviously that it generates an error,ok, my question is if, there is an instruction or a function to validate if ANY array is empty.
I tried this
Call-->
bFlag= bEmpty(arr())
Function-->
Function bEmpty(rgArr() as anyType) as boolean
On Error Resume Next
If LBound(rgArr())<0 then
bEmpty=True
else
bEmptyFalse
End If
End Function
but, as you can see, if i had 10, 15, 'x' number of arrays i would need to do one function by array.....
-
Oct 13th, 2000, 02:48 PM
#2
transcendental analytic
There isn't, artificially you could check for subscript out of range error:
Code:
On error resume next
X=Arrayname(0)
if err=9 then msgbox "empty array"
on error goto 0
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Oct 19th, 2000, 05:26 AM
#3
New Member
Elements in Array
Why don´t you use intElements = Ubound(anyArray)
That will return the number of elements stored in the array.
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
|