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

Dynamic Variable question

Status
Not open for further replies.

glwong

Programmer
Jul 13, 2001
15
US
I am creating dynamic variables
using the following code:

i=0
while (...)
execute("Var"&i&"= Y")
i = i +1
next

the problem is I don't know how to
check the value of that variable later on
in the code, right now I'm doing this, but
don't think it's working

i=0
while(...)
if execute("Var"&i&"= Y") then
Response.write("in here")
end if
next

any suggestions?

Thanks in advanced
 
I think the problem is with your

Code:
execute("Var"&i&"= Y")

line. You're trying to allocate a string value (Y) to a variable without enclosing it in quotes.

Try

Code:
execute("Var"&i&"= 'Y'")

and see what happens.
 
Hello qlwong,

There is no such thing as while ... next. It is either
while (...)
'etc
wend
or
do while (...)
'etc
loop

Also, be careful about the scope. There is also a global execute available.

regards - tsuji
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top