Forum Moderators: open
Code:
pop=finalanswersArray(n)
Response.Write ("pop is "&pop&"<br>")
select case pop
Case "agriculture/forestry management"
count1=count1+1
Case "defense related"
count2=count2+1
Case "disaster evaluation"
count3=count3+1
Case "education"
count4=count4+1
Case "engineering/ transportation"
count5=count5+1
Case "land management/land cover"
count6=count6+1
Case "mapping"
count7=count7+1
Case "resource exploration"
count8=count8+1
Case "scientific/environmental research"
count9=count9+1
Case "urban dynamics"
count10=count10+1
Case "other"
count11=count11+1
Case else
count12= count12+1
end select
for n=0 to ubound(finalanswersArray)-1
pop=finalanswersArray(n)
Response.Write ("pop is "&pop&"<br>")
select case LCase(pop)
Case "agriculture/forestry management"
count1=count1+1
Case "defense related"
count2=count2+1
Case "disaster evaluation"
count3=count3+1
Case "education"
count4=count4+1
Case "engineering/ transportation"
count5=count5+1
Case "land management/land cover"
count6=count6+1
Case "mapping"
count7=count7+1
Case "resource exploration"
count8=count8+1
Case "scientific/environmental research"
count9=count9+1
Case "urban dynamics"
count10=count10+1
Case "other"
count11=count11+1
Case else
count12= count12+1
end select
next
Response.write(count1&","&count2&","&count3&"<"&count4&"<"&count5&"<"&count6&"<"&count7&"<"&count8&"<"&count9&"<"&count10&"<"&count11&"<"&count12)
And here is the output: 1,1,<<<<<1<<<<15
Every count should have at least a value of 1, but they are not. Also some should have a value of more than 1, but they are not.
I did try the lowercase and it did not make a difference.
Option Explicit is a good idea too, which forces you to declare the variables before you use them. It's a good safety, especially since so many of your variables are similar.