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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic Variable

Status
Not open for further replies.

sarr

Programmer
Oct 4, 2000
8
US
I require the variables to be declared dynamically like this

For i = 1 to 20
Dim var & i
Next

for which i expect output like
Dim var1, var2, var3..

Later on, i should use this in my program like,

For i = 1 to 20
var & i = "somevalue"
Next

Could someone help me to build this code correctly.
 
Sounds to me like you are looking for an array, where the names of the values would be:

theArray[1], theArray[2], theArray[3], ... theArray[n]

yes?

:)
Paul Prewett
 
Whoops, wrong forum. ;-)

theArray(1), theArray(2), theArray(3), ... theArray(n)


Wouldn't it be nice if there were only one programming language?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top