Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to check if a specific element is in an array - issue

Status
Not open for further replies.

FireGeek21

Technical User
Dec 12, 2007
218
US

I need to find out if an array parent.EligPlans[2] has a specific plan in it. If so, then I need to assign it to a variable for later use after a "for" loop. There are some elements in this array I don't want to deal with (apply a custom message in this case) but there are 7 specific elements I do need to apply a custom message for.

Tried the following code to create an array of elements I am looking for and then check if parent.EligPlans[2] has an element I want. The long and short of it is that I am getting this message, "Object doesn't support this property or method."

Thoughts on what I am doing wrong or what I should do?

Thanks!!!

JavaScript:
var customMsgPlan = new Array("a", "b", "c", "d", "e", "f", "g", "h");
for (var i=1; i<parent.EligPlans.length; i++) 
{
for (var c=1;  c<customMsgPlan.length; c++)
	{
	if (customMsgPlan.indexof(parent.EligPlans[i][2]) >= 0)
		{
		customMsg = parent.EligPlans[i][2]
		}
	}
	// Other code
}




FireGeek
(currently using Crystal Reports XI with Lawson 9.01)
 
I think that the relevant method is
Code:
index[red]O[/red]f()

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top