Maxwell Smart wrote:
> I'm trying to output the results of a query similar to:
>
> #productrange1.name#
>
> however I would like to increment the 1 based on the ID of another table such
> as
>
> #productrange#ID#.name#
>
> however obviously this is not allowed.
>
> any suggestions please?
No, it's not allowed. You've three options here, a bad one and two good
ones.
The bad one is to use Evaluate(). Don't do this. It's slow and makes
code hard to maintain more often than not. If you see it as really
being your only option (which it shouldn't be), then here's what you
do:
#Evaluate("productrange#ID#").name#
The first good option is to store all your product ranges in an array
(if the id range is dense), that way, you could do something like:
#productranges[ID].name#
The third option is to store them in structs. This is good if your range
of ids is typically sparse, or textual. Referencing an element of the
struct is the same as for arrays.
K.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble
Ticket application
http://www.houseoffusion.com/banners/view.cfm?bannerid=48
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:204240
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54