[RESOLVED] vbscript to trap counter
Just trying to extract a counter in a loop to assign as a variable in a script, for example-
count=0
Do Until Count > 1
count=count+1
Line(count) = "blah,blah, blah" <- I need this line to be translated as follows
Line1 = "blah,blah, blah"
Loop
How do I insert the counter # (number1) in the variable name?
Re: vbscript to trap counter
You don't... the usual way to do that kind of thing is to create an Array (a variable with many elements), and refer to each item as you did on the first of those lines (eg: Line(count)= ... and ... = Line(count) , etc).
There is a good article about arrays in the "Data types/variables" section of our Classic VB FAQs (in the FAQ forum). While VBScript and Classic VB have several differences, I'm fairly sure that this is one area where they are identical.