J
John A Grandy
In VB6 you could get away with the following code:
Dim Index As Integer
Dim ItemsCount As Integer
Dim StringArray() As String
Dim StringValue As String
'....
'at runtime , ItemsCount is determined from a database query, or a
user-entry, etc.
'....
For Index = 0 To ItemsCount - 1
'each StringValue is determined at runtime from a database query, or a
user-entry, etc.
ReDim StringArray(0 To Index) As String
StringArray(Index) = StringValue
Next Index
However, you can't do this in VB.NET ... (compile-time error on ReDim)
Does anyone know an alternative coding method ?
Thanks.
Dim Index As Integer
Dim ItemsCount As Integer
Dim StringArray() As String
Dim StringValue As String
'....
'at runtime , ItemsCount is determined from a database query, or a
user-entry, etc.
'....
For Index = 0 To ItemsCount - 1
'each StringValue is determined at runtime from a database query, or a
user-entry, etc.
ReDim StringArray(0 To Index) As String
StringArray(Index) = StringValue
Next Index
However, you can't do this in VB.NET ... (compile-time error on ReDim)
Does anyone know an alternative coding method ?
Thanks.