hi

in my j2me code, i have a choice group dropdown whose values are got from web content as a string array. i am using the following for loop to get the selected value of the choice group

for(int i=0;i<2;i++) {
			if(cust.isSelected(i)) {
				f = cust.getString(i);
				}
				}

my problem is instead of hard coding the 'i<2' bit, i wanted a way of the choicegroup size to be determined automatically so that i dont have to enter the value manually

thanks

you can always use your string array length as parameter in the loop for(int i=0;i<stringArray.length;i++)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.