|
-
Jul 10th, 2000, 04:05 PM
#1
Thread Starter
Hyperactive Member
How do you get the LenB of an array? How do you call it??
Any ideas?
BW
-
Jul 10th, 2000, 04:24 PM
#2
transcendental analytic
Well usually you use LenB with UDT's, so i guess you could use it like this
Code:
Private Type sArray
s(10) As String
End Type
Private Sub Form_Load()
Dim a As sArray
MsgBox LenB(a)
End Sub
It will show a empty variable length string array of 10 items will take up 44 bytes
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.
-
Jul 10th, 2000, 04:40 PM
#3
Thread Starter
Hyperactive Member
Will that work?
I need to redimension the array within a sub, will that still work if its in a UDT?
BW
-
Jul 10th, 2000, 05:37 PM
#4
transcendental analytic
You would need to redefine it then...
Code:
Private Type sArray
s() As String
End Type
Private Sub Form_Load()
Dim a As sArray
redim a.s(30)
MsgBox LenB(a)
End Sub
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.
-
Jul 10th, 2000, 05:45 PM
#5
Thread Starter
Hyperactive Member
Cool, thought so
I thought that might be it, hadn't tried it just yet. Good to hear its possible though.
BW 
BTW is your website fully functional? Went to take a look, and it took a while (only got to the Kedaman.com site, not the Geocities site).
-
Jul 10th, 2000, 06:13 PM
#6
transcendental analytic
Yeah, geocities is a bit crappy today, well you can have a direct link here:
http://www.geocities.com/kedasu/homepage.htm
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.
-
Jul 10th, 2000, 08:00 PM
#7
Frenzied Member
Unless you're using Variants or strings then you can just multiply the LenB of the first element by the number of elements, If it's a String use LenB(Join(Arr(),""))
Here's a quick Demo
Code:
Private Sub Command1_Click()
Dim s(5 To 8) As String
Dim l(-4 To 9) As Long
Dim i As Integer
For i = 5 To 8
s(i) = "Hello" & Space(i)
Next i
For i = -4 To 9
l(i) = i
Next i
MsgBox LenB(Join(s, ""))
MsgBox LenB(l(LBound(l))) * (UBound(l) - LBound(l))
End Sub
-
Jul 11th, 2000, 06:01 PM
#8
transcendental analytic
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.
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
|