Reputation: 7573
I have a struct like this:
SESSION.Auth.Access["1"]["2"]["Write"]
If I cfdump
the struct #SESSION.Auth.Access#
I can see the struct in full and it 100% has the data in nested arrays.
However if I use this statement:
#StructFindValue(SESSION.Auth.Access["1"], '2', 'ALL')#
I am getting an empty array. If I use:
#ArrayLen(StructFindValue(SESSION.Auth.Access["1"], '2', 'ALL'))#
Then it returns a zero for the array length.
Am I doing something obviously wrong or is there a possible string/numeric issue going on?
Upvotes: 0
Views: 162
Reputation: 31930
So your struct could also be written like this?
SESSION.Auth.Access = {
'1' = {
'2' = {
'Write' = 'foobar'
}
}
}
'2' is a key, not a value, so you'd need to use StructFindKey instead of StructFindValue.
Indeed this returns for me an empty array:
<cfdump var="#StructFindValue(SESSION.Auth.Access['1'], '2', 'ALL')#">
But this returns me the 'Write' struct
<cfdump var="#StructFindKey(SESSION.Auth.Access['1'], '2', 'ALL')#">
Upvotes: 6