Forum Discussion
TMaCEvans_92750
Nimbostratus
Jan 17, 2011nesting switch within aif statement
I'm trying to nest a switch statement in a if statement but am getting a parse error
[parse error: PARSE syntax 302 syntax\ error\ in\ expression\ \"\ switch\ -glob\ \[string\ tolower\ \[HTTP::u...
LiefZimmerman
Admin
Jun 24, 2022Cool - thanks JRahm.
I nominated this to become a CrowdSRC codeshare article Viv_Richards.
PS. Getting a "clever" rating from Jason is, IMO, a feather in your cap. 🎓
- Dec 20, 2006I haven't used the PHP interface and don't know the language so well, but what I do see is that you are passing in a 1-D array for the first parameter and a 1-D array for the second parameter.
struct MemberSessionState { IPPortDefinition member; EnabledState session_state; }; void LocalLB::PoolMember::set_session_enabled_state( in String[] pool_names, in MemberSessionState[][] session_states );
- Omachonu_Ogali1Dec 21, 2006Historic F5 AccountI initially tried passing a 2-level array as the second argument, but I get an exception from iControl saying that the member object could not be found. If I do a 1-level array, it goes through without a problem, without any exceptions thrown.
- Dec 21, 2006Well, I can guarantee that it is in fact a 2-D array that is required. Odds are the reason why you aren't getting an error for a 1-D array is that the server code is looking at that 1-D array and treating it as an empty 2nd dimension, thus no members for the associated pools.
- Omachonu_Ogali1Dec 22, 2006Historic F5 AccountI did some more testing, and even renamed my 1-D array keys to incorrect names (i.e. NOT member and monitor_state), and it still accepted the parameters without throwing an exception. It refuses a 2-D array, so I ended up creating a class and referencing that as an object. Now, it works flawlessly...
- Omachonu_Ogali1Dec 22, 2006Historic F5 AccountNever mind that last post, totally unnecessary. I was interpreting it as a 2-dimension array, when it's actually a 3-dimension array (first index is the pool, second index is the pool member, third is the actual value). No need for the classes and object references.