flak 0 Posted February 21, 2007 Report 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 Quote Link to post Share on other sites
flak 0 Posted February 21, 2007 Author Report 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 Quote Link to post Share on other sites
pulpfiction 0 Posted February 21, 2007 Report Share Posted February 21, 2007 Just a suggestion. Rather than having multiple IF's it will look easier if you use SWITCH CASE..... Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.