Jump to content

Creating a unique variable while looping


flak

Recommended Posts

Hi,I have a loop and I want a new variable to be created each time the loop goes round. Some simplified code:

i=1do while i <3SQL="select...."rs1=execute SQLvarCost=rs1("cost")i=i+1loop

I would like it so that varCost changed to varCost1, varCost2, varCost3 etc. :)Thanks

Link to comment
Share on other sites

Panic over, I have sorted it using an if statement if anyone is interested.

i=1do while i <3SQL="select...."rs1=execute SQL  if i=1 then	varCost1=rs1("cost")  elseif i=2 then	varCost2=rs1("cost")etc...  end ifi=i+1loop

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...