msgbartop
by Joe Zack
msgbarbottom

24 Sep 08 ColdFusion Dynamic Variable Names

I was just browsing the ColdBox Frameworksource code and I saw something that I didn't know was possible.

<cfset "instance.context.#arguments.name#" = arguments.value>

I would have written it like so:

<cfset instance.context[arguments.name] = arguments.value>

I can't think of a reason to use one over the other. Sway me.

Tags: ,

Leave a Comment