Hi Mark,

you wrote:

>I have this working using session variables, and it's no big deal, but
>there must be another way to do this.
>  
>

Cutting the rest short what you are doing is OK as it is one of many 
ways to talk to/with a structure (as shown in all of the other replies 
to this post)  but you also mention that you are on CF5 and not every 
scope is a structure in CF5 so it won't work for some scopes. I would 
suggest using the request scope as that behaves nicely as does the 
session scope as you discovered :-)

HTH

Kym K


> 
>Basically, what I want to be able to do is append a counter variable to
>an existing variable name. For instance, let's assume the following
>truncated working code:
> 
><cfset mail_recipients = "[EMAIL PROTECTED]">
><cfset session.db_name1 = "d:\serverpath\databases\admin.mdb">
><cfset session.db_name2 = "d:\serverpath\databases\answer.mdb">
><cfset session.title1 = "Admin Database">
><cfset session.title2 = "Answer Database">
> 
><!-- loop over the variables, gzip the db and send the email --->
><cfloop from="1" to ="2" index="i">
> 
><cfx_gzip 
> action = "gzip"
> infile  = "#session['db_name'&i]#"
> level  = "9">
> 
><cffile 
> action  = "move"
> source  = "#session['db_name'&i]#.gz"
> destination = "#session['db_name'&i]#.gz">
> 
><cfmail  
> to   = #mail_recipients#
> from   = "[EMAIL PROTECTED]"
> subject  = "LDC #session['title'&i]# for
>#DateFormat(Now(),"yyyy-Mm-dd")#">
> <CFMAILPARAM FILE="#session['db_name'&i]#.gz">
></cfmail>
> 
></cfloop>
> 
>Appending the relevant i counter to the db_name and title works fine as
>long as I use session variables with that syntax eg
>="#session['db_name'&i]#. But there must be a way to do this without
>having to use sessions. Any ideas? I tried changing session to
>attributes and also variables, but both throw a wobbly and say they
>can't find #attributes['db_name'&i]# ... 
> 
>I forgot to mention, I'm on a CF5 server here.
> 
>TIA
>Mark
>
>
>  
>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:227576
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

Reply via email to