flak Posted February 21, 2007 Share Posted February 21, 2007 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 More sharing options...
flak Posted February 21, 2007 Author Share Posted February 21, 2007 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 More sharing options...
pulpfiction Posted February 21, 2007 Share Posted February 21, 2007 Just a suggestion. Rather than having multiple IF's it will look easier if you use SWITCH CASE..... Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now