Re: Finding the value of a key in a nested structure

2010-06-15 Thread Tom King
Cheers Ray - simple is good!! :) On 14 June 2010 17:02, Raymond Camden rcam...@gmail.com wrote: Evaluate is slow - comparatively. It isn't horrible though. The main reason I will complain about evaluate is when it isn't strictly necessary. Technically it isn't in your case. You could break

RE: Finding the value of a key in a nested structure

2010-06-14 Thread Andy Matthews
When working with structures nested that deeply you might consider IsDefined instead. cfif IsDefined('session.currentUser.permissions.' arguments.path) It's not a best practice necessarily, but it would prevent a whole bunch of StructKeyExists calls. andy -Original Message- From:

Re: Finding the value of a key in a nested structure

2010-06-14 Thread Tom King
Cheers Andy - That's fine if I want to check the struct exists, but I'm trying to directly test against the value of that path (which in this case is a boolean)...? T On 14 June 2010 15:25, Andy Matthews li...@commadelimited.com wrote: When working with structures nested that deeply you

Re: Finding the value of a key in a nested structure

2010-06-14 Thread Tom King
nevermind - found the solution! ended up with: cffunction name=checkPermission cfargument name=path cfif IsDefined('session.currentUser.permissions.' arguments.path) cfif evaluate('session.currentUser.permissions.' arguments.path)

Re: Finding the value of a key in a nested structure

2010-06-14 Thread Raymond Camden
Evaluate is slow - comparatively. It isn't horrible though. The main reason I will complain about evaluate is when it isn't strictly necessary. Technically it isn't in your case. You could break up the string into parts and check the existence of each - but I think your code is fine (and a hell