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

initializing variables in a for loop

Status
Not open for further replies.

mleduc

Programmer
Dec 5, 2001
20
CA
Hi yesterday I post a message to know how create variables in a for loop.

Now my problem is that I want to put a string in those variables but could not figure it how???

here what I tried

For i = 1 to 60
If eval(&quot;x&quot; & i) <> &quot;&quot; Then
execute &quot;Dim y&quot; & i
execute &quot;y&quot; & i = &quot;String&quot; << stoped here ????
End if
Next

Error return
Microsoft VBScript runtime error '800a000d'

Type mismatch: 'execute'

Help please
 
Any reason you aren't using an array?? It seems to me like that would be easier.
 
execute &quot;y&quot; & i = &quot;String&quot; << stoped here ????

wouldn't need the execute there if all you're doing is assigning variables, but I agree with MNClimber. Use an array for this type of application.
penny.gif
penny.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top