On Tue, Jun 14, 2005 at 09:26:01PM +1000, Chad Renando wrote:
> I am doing the architectually unthinkable and storing variable names
> in my database. How would I go about determining if the variable is
> defined?
>
> I tried something like (where the value returned by
> MyQuery.MyStoredVariableName is "id0"):
>
> <cfif isdefined("#evaluate(MyQuery.MyStoredVariableName)#")>
> Stuff
> </cfif>
>
> But it carks it when trying to evaluate the variable when it's not
> defined, saying id0 is not defined. Any ideas?
hrm, trying to work out what all that quoting and evaluating achieves.
Without thinking too hard about it, aren't you wanting something along
the lines of:
<cfif isDefined(MyQuery.VariableColumn)>
My variable name is #MyQuery.VariableColumn#
Its value is #Evaluate(MyQuery.VariableColumn)#
</cfif>
> Yeah, and feel free to tell me about best practice of storing variable
> names in the DB... bring it on, baby!
My mother always said if you don't have something nice to say... ;)
It seems to me that in any situation where you could do this, you'd be
better off just storing the value in the db somewhere - but that's gut
feeling, I can't back it up with figures.
-T
---
You are currently subscribed to cfaussie as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]
Aussie Macromedia Developers: http://lists.daemon.com.au/