|
-
Feb 1st, 2011, 11:49 AM
#1
Thread Starter
Junior Member
[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?
-
Feb 1st, 2011, 12:32 PM
#2
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|