VB6 Defining an Array's Name with a String

Andy2004
01-30-2008, 11:05 AM
(sorry if this is the wrong forum or something)

Is it possible to define an arrays name with a string?

for example

Dim arrayname As String * 1
arrayname = "A"

ReDim arrayname(10) as string

and the arrary would come out, A(1), A(2), A(3) etc.

The reason i want to so this is because i want to use a loop to create arrays, after the first loop i will increment the "A" to a "B" and soo on. At the moment my efforts result in,

Compile Error: Expected Array

Hope you can help, and thanks for reading this.

Andrew

Hugh Lerwill
01-30-2008, 11:27 AM
>Is it possible ...

No

Sounds like you need a two dimensional array as in;

Dim MyArray(10,3)

after the first loop you can then increment the second dimension to 1, 2, 3 etc.

dilettante
01-30-2008, 03:37 PM
What would you even use this for?

Even if it worked, how would you operate on these A, B, C arrays in subsequent code?

We might suggest some additional alternatives you could use if you describe the problem you're trying to solve.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum