gmailrules
asked on
*Need Muso's Help with this one*
when I trace:
departmentArray.department [0].servic e.name
departmentArray.department [0].servic e[0].compo nent.name
departmentArray.department [0].servic e[0].compo nent[0].va lues.name
I get:
math
student_checkin
menu
shouldnt it be more like this?
departmentArray.department [0].name
departmentArray.department [0].servic e[0].name
departmentArray.department [0].servic e[0].compo nent[0].na me
Easy fix?
departmentArray.department
departmentArray.department
departmentArray.department
I get:
math
student_checkin
menu
shouldnt it be more like this?
departmentArray.department
departmentArray.department
departmentArray.department
Easy fix?
ASKER
Well it works great no doubt. I just saw it as a lil confusing. The reason why I wanted to rename the variables in the first place was to make it easier to understand. It works , and that's whats most important so it's really not a big deal. But this is what I'm talking about:
departmentArray.department [0].servic e.name //I would think this variable would contain the value "student_checkin" since its the first sevice. but instead its value is the department name.
//The variable has "service.name" in it so it just seems to reason that that is what it would return.
//wouldn't something like "departmentArray.departmen t[0].name" be a better choice to hold the department name?
I wasn't sure if this was something really simple to change so that's why I'm asking. If you don't see the point in changing it then oh well. It works anyways :D
Thanks a lot,
John
departmentArray.department
//The variable has "service.name" in it so it just seems to reason that that is what it would return.
//wouldn't something like "departmentArray.departmen
I wasn't sure if this was something really simple to change so that's why I'm asking. If you don't see the point in changing it then oh well. It works anyways :D
Thanks a lot,
John
Actually I've been thinking again, and I know now that I can make the change you request without much of a problem, whilst keeping it flexible.
I'm off out for the day now, but I'll post a solution up later for you.
I'm off out for the day now, but I'll post a solution up later for you.
ASKER
ok, great. thank you :)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Exactly what I wanted. Thanks a lot Muso!
departmentArray.department
The thing is, I deliberately made the routine flexible, so that if you have different XML categories, you can simply change:
_root.categoryArray = new Array("department", "service", "component","values");
and you have a similar structure (to any depth required) for that too.
"values" is a holder (like "department"), and although there aren't multiple entries, it leaves the capability there to do so.
Do you honestly see this as a problem!?