|
-
Nov 27th, 2002, 06:31 PM
#1
Thread Starter
Hyperactive Member
dynamic array
VB Code:
Dim strDescription As String, intTemp As Integer, intContains As Integer
For Each Item In strFullError
intContains = intContains + 1
Next
intContains = intContains - 1
MsgBox intContains
For intTemp = 0 To intContains Step 1
intTemp = intTemp + 1
MsgBox intTemp
MsgBox strFullError(intTemp)
strDescription = strDescription & " " & strFullError(intTemp)
Next
im tryin to get all of the indexes from an array except for the first one (0) but when the second for loop runs, it increments in 2s? and goes from 1 to 3 so im gettin a subscript out of range errormibob, anyone know why? 
cheers
ps, its in a function where strfullerror is declared as an arrayed string like strFullError() as String, im new to arrays please bare with mee :P
-
Nov 27th, 2002, 06:40 PM
#2
Need-a-life Member
Try this:
VB Code:
Dim strDescription As String, intTemp As Integer, intContains As Integer
For Each Item In strFullError
intContains = intContains + 1
Next
intContains = intContains - 1
MsgBox intContains
For intTemp = 1 To intContains
MsgBox intTemp
MsgBox strFullError(intTemp)
strDescription = strDescription & " " & strFullError(intTemp)
Next
Emiliano F. Martín
If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
Encourage the person who helped you to keep doing it, and give him the points he deserves.
MP3 Organizer: Freeware to logically organize all your MP3s.
-
Nov 27th, 2002, 06:43 PM
#3
Thread Starter
Hyperactive Member
oo, taaaaaa! i cant even see wat u changed let me take a closer look cheers again
-
Nov 27th, 2002, 06:45 PM
#4
Thread Starter
Hyperactive Member
o i c!! the for increments it itself so mine was doin it twice.. haha im stupid :P
-
Nov 27th, 2002, 06:46 PM
#5
Need-a-life Member
-
Nov 27th, 2002, 09:09 PM
#6
Fanatic Member
VB Code:
Public Function CountArIndx(myArray() As String) As Integer
For CountArIndx = LBound(myArray()) To UBound(myArray())
'MsgBox CountArIndx
Next
End Function
Is this what you need?
Stick this in a module and just call it up. This will return the number of indexes contained in your 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
|