Click here to Skip to main content
15,886,840 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
for (var i:int=0;i<=length;i++) 
{
	SelFra +=SelFranchise[i] +"| ";
}


What I have tried:

There are list of attributes.If i=0 then it has to take 2 values but it is iterating only once and coming out of loop..
Posted
Updated 27-May-16 5:30am
v2
Comments
CHill60 25-May-16 14:36pm    
Where are you assigning a value to length?
Member 11527624 25-May-16 14:40pm    
if(cbFranchise.selected==true)
{

var franchiz:Array=new Array();
var length:int;
length=SelFranchise.length;

for (var i:int =0;i <= length; i++)
{

SelFra +=SelFranchise[i] +"| ";

}
if (SelFra != "" && SelFra != "Any") {

WhereClause += " NAME_OF_FRANCHISE like '%"+SelFra+"%'";
}
else{
ShowAlert("Please Select atleast one Franchise name from the list of Franchises");
return;
}


}

This is the entire code the SelFranchise is the data provider that i have declared starting of my project
CHill60 25-May-16 14:43pm    
Well I'm guessing that length = 0 when you run this.
Member 11527624 25-May-16 15:32pm    
no i am getting the lenght=2 because in the application i have given 2 attributes in the list.Thats y i am confused and posted
CHill60 25-May-16 16:36pm    
Have you tried stepping through your code and watching the variables to see what is happening

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900