Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Arrays and Split()

Status
Not open for further replies.

Michael42

Programmer
Oct 8, 2001
1,454
US
If using an array created via a Split() do I need to ReDim it if every time I use it as shown below? If yes, I have never used ReDim, please give example using below context.

Many Thanks!!!


'ComboBox Control Test
isComboDBField = false
for n = 1 to UBound(aComboTables)
aComboTemp = Split(aComboTables(n), ",")
if aComboTemp(0) = aFieldNames(i) then
isComboDBField = true
exit for
end if
next
 
' No need to redim. But you can get array with UBound = -1
MsgBox Cstr(Ubound(Split("",",")))' 0-length entry
for n = 1 to UBound(aComboTables)
aComboTemp = Split(aComboTables(n), ",")
if Ubound(aComboTemp) >= 0 then
if aComboTemp(0) = aFieldNames(i) then
isComboDBField = true
exit for
end if
End if
next Generate Forms/Controls Resizing/Tabbing Class
Compare Code (Text)
Generate Sort Class in VB or VBScript
 
Great, thanks for the advice and confrimation on this.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top