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

Declare multiple variables

Status
Not open for further replies.

sn0rg

IS-IT--Management
Aug 5, 2005
95
GB
I need to have a load of similar string variables in my script, with the same name, but incremented with a number. Normally I would do something like:

Code:
dim item1, item2, item3, item4, item5, item6

I was hoping that there may be an easier way to refer to these, but am a bit rusty on vbscript - can anyone see a more efficient way to declare, and then refer to these variables?

Thanks
 
sn0rg,
what about using an array and then a loop to populate it?
regards,
longhair
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top