how about this:

<cfset counter = 0>
<cfset subcounter = 0>

<cfoutput>
<cfloop index="i" from="1" to="#foo.recordcount#">
     <cfif counter NEQ foo.section[i]>
     <!--- incremented, so reset subcounter to 0 --->
          <cfset counter = foo.section[i]>
          <cfset subcounter = 0>
     </cfif>
      dqm__subdesc#foo.section[i]#_#subcounter# = "#foo.pagetitle[i]#" ;
</cfloop>
</cfoutput>


Duncan Cumming
IT Manager

http://www.alienationdesign.co.uk
mailto:[EMAIL PROTECTED]
Tel: 0141 575 9700
Fax: 0141 575 9600

Creative solutions in a technical world

----------------------------------------------------------------------
Get your domain names online from:
http://www.alienationdomains.co.uk
Reseller options available!
----------------------------------------------------------------------
----------------------------------------------------------------------


                                                                                       
                            
                    Dave Phipps                                                        
                            
                    <[EMAIL PROTECTED]        To:     <[EMAIL PROTECTED]>              
                       
                    cf.co.uk>            cc:                                           
                            
                                         Subject:     Re: [ cf-dev ] Javascript menus 
from query                   
                    02/25/03                                                           
                            
                    03:07 PM                                                           
                            
                    Please                                                             
                            
                    respond to                                                         
                            
                    dev                                                                
                            
                                                                                       
                            
                                                                                       
                            



Not bad but it results in this output:

   dqm__subdesc0_0 = "Welcome Message" ;
   dqm__subdesc0_1 = "Introduction to Methodism" ;
   dqm__subdesc0_2 = "Our Calling" ;
   dqm__subdesc0_3 = "Structure of the Church" ;
   dqm__subdesc0_4 = "History of the Church" ;
   dqm__subdesc0_5 = "Beliefs of the Church" ;
   dqm__subdesc0_6 = "Essential Contacts" ;

   dqm__subdesc1_7 = "Special Sundays" ;
   dqm__subdesc1_8 = "Creative Arts" ;
   dqm__subdesc1_9 = "Evangelism" ;

   dqm__subdesc2_10 = "Current News" ;

   dqm__subdesc3_11 = "Resources & Publications" ;
   dqm__subdesc3_12 = "Methodist Conference" ;
   dqm__subdesc3_13 = "World Conference" ;
   dqm__subdesc3_14 = "Getting onto the Internet" ;
   dqm__subdesc3_15 = "Resourcing Mission" ;
   dqm__subdesc3_16 = "TMCP" ;
   dqm__subdesc3_17 = "Children & Young People" ;
   dqm__subdesc3_18 = "Women's Network" ;
   dqm__subdesc3_19 = "World Church" ;

   dqm__subdesc4_20 = "Links" ;

   dqm__subdesc5_21 = "Get Involved" ;

Only the first section is correct.  Each section needs to start at 0.  So
dqm__subdesc1_7 = "Special Sundays" ; should have been dqm__subdesc1_0 =
"Special Sundays" ;

Any more suggestions?

Thanks

Dave

At 14:57 2/25/2003 +0000, you wrote:

>this won't do all you want, if you're wanting to assign things statically,
>but you can always take care of that after/before the looping:
>
><cfoutput>
><cfloop index="i" from="1" to="#foo.recordcount#">
>      dqm__subdesc#foo.section[i]#_#DecrementValue(i)# = "
#foo.pagetitle[i]
>#" ;
></cfloop>
></cfoutput>
>
>??
>
>
>Duncan Cumming
>IT Manager
>
>http://www.alienationdesign.co.uk
>mailto:[EMAIL PROTECTED]
>Tel: 0141 575 9700
>Fax: 0141 575 9600
>
>Creative solutions in a technical world
>
>----------------------------------------------------------------------
>Get your domain names online from:
>http://www.alienationdomains.co.uk
>Reseller options available!
>----------------------------------------------------------------------
>----------------------------------------------------------------------
>
>
>
>
>                     Dave
> Phipps
>
>                     <[EMAIL PROTECTED]        To:     ColdFusion User group
> <[EMAIL PROTECTED]>
>                     cf.co.uk>            cc:
>
>                                          Subject:     [ cf-dev ]
> Javascript menus from query
>                     02/25/03
>
>                     02:51
> PM
>
>                     Please
>
>                     respond
> to
>
>                     dev
>
>
>
>
>
>
>
>
>
>
>Hi,
>
>I am looking into ways of setting up something and I was wondering if
>anyone could provide some suggestions/code etc.
>
>I have some drop-down menus which us the following syntax to build each
>drop-down:
>
>dqm__subdesc2_0 = "News Service" ;
>   dqm__subdesc2_1 = "Flame";
>   dqm__subdesc2_2 = "Diary";
>   dqm__subdesc2_3 = "Conference";
>   dqm__subdesc2_4 = "Media Office";
>   dqm__subdesc2_5 = "Grants & Funds";
>   dqm__subdesc2_6 = "Campaigns";
>
>This set of menuse would be for the News section with an id of 2.
>
>Now what I want to be able to do is calculate the second number
dynamically
>
>so that I have something like this:
><cfoutput query=foo>
>dqm__subdesc#section#_#item# = "#pagetitle#" ;
></cfoutput>
>
>The problem is that the query grabs not only section id 2 but also many
>other sections.  Therefore I can't use queryname.currentrow as it also has
>to start with a 0 (zero) for each new drop-down.  E.g.:
>
>dqm__subdesc2_0 = "News Service" ;
>   dqm__subdesc2_1 = "Flame";
>   dqm__subdesc2_2 = "Diary";
>   dqm__subdesc2_3 = "Conference";
>
>   dqm__subdesc3_0 = "Media Office";
>   dqm__subdesc3_1 = "Grants & Funds";
>   dqm__subdesc3_2 = "Campaigns";
>
>If any of the numbers are missed then the drop-down does not work.  Has
>anyone ever done anything like this before?
>
>There is also the added complication of fixed items which are no
changeable
>
>which would be statically assigned to the list.
>
>So in the example above it might end up like this:
>
>dqm__subdesc2_0 = "News Service" ;
><cfoutput query=foo>
>dqm__subdesc2_#item# = "#pagetitle#" ;
></cfoutput>
>
>   dqm__subdesc3_0 = "Media Office";
>   dqm__subdesc3_1 = "Grants & Funds";
>   dqm__subdesc3_2 = "Campaigns";
><cfoutput query=foo>
>dqm__subdesc3_#item# = "#pagetitle#" ;
></cfoutput>
>
>The dynamic menus would then have to start from the next number in the
>array - what is the best way to do this?
>
>My other option is to create an admin page where you have to assign the
>#item# number to each menu which I want to avoid if possible.
>
>Cheers
>
>Dave
>
>
>--
>** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
>
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>For human help, e-mail: [EMAIL PROTECTED]
>
>
>
>
>
>
>--
>** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
>
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>For human help, e-mail: [EMAIL PROTECTED]


============================================
Phipps CF Development
Oxford, Oxfordshire.
Telephone: +44(0)7718 896696
http://www.phipps-cf.co.uk
============================================


--
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]






-- 
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]

Reply via email to