I am very novice at asp. Here is my code:
response.write(\"
Not sure I should be answering this, but to loop and only write out on the even iteration use Mod()
to test the remainder.
response.write("<script>")
dim counter: counter = 0
do until rs.EOF
for each x in rs.Fields
counter = counter + 1
'Use Mod() to check counter is even
If counter Mod 2 = 0 Then response.write "var CC" & counter & "=" & x.value & ";"
next
rs.MoveNext
loop
response.write("</script>")
Useful links
Ad an IF statement, based on your counter.
for each x in rs.Fields
counter = counter + 1
if(counter = 1) then
response.write "var CC" & counter & "=" & x.value & ";"
end if
next
Try this
response.write("<script>")
dim counter: counter = 0
do until rs.EOF
for each x in rs.Fields
counter = counter + 1
if IsNumeric(x.value) then
response.write "var CC" & counter & "=" & x.value & ";"
end if
next
rs.MoveNext
loop
response.write("</script>")
The trick is to check "If IsNumeric"
then do what you want.