Variable not declared. How I fixed it.

Variable not declared. How I fixed it.

I need to know the number of items in a picklist. So I put a counter in a loop of the picklist like this:

count1 = count + 1;

Zoho didn't like it. Gave the error: "variable not declared"

So I tried putting this before the loop:

count1 = 0;

Lo and behold, that solved the error.