I reuse the following code a good 15 times with each different variable name (the variables being curA1, curA2, curA3, etc. and curA1Num, curA2num, curA3num, etc.) I know there has to be better code than an endless page of ifs. I have come to notice from forums and other pages I have found online that it is difficult and some say very bad to do dynamic variables in ASP. Thankfully they work awesome in flash. How do I not repeat my code for each variable? I offer sincere thanks to whomever has an answer to what is currently a long and very badly structured ASP page.
Overly reused code:
Expand|Select|Wrap|Line Numbers
- if rs.fields("A1")<>"" then
- if rs.fields("A1")<>999 then
- curA1 = curA1 + rs.fields("A1")
- curA1Num = curA1Num + 1
- end if
- end if
Expand|Select|Wrap|Line Numbers
- <%= Int(curA1/curA1Num) & "%" %>
The experienced Flash developer and severly novice ASP programmer