September 07, 2008
For ColdFusion hosting try HostMySite.com. |
Home /
Groups /
ColdFusion Talk (CF-Talk)
defining variables in a new loop from an old loop
<cfdirectory directory="F:\MP3Music" name="Artists" sort="name ASC, size DESC" >travis mitchell 05/13/08 01:57 A #evaluate('Songs#k#.name')#William Seiter 05/13/08 03:17 A Eww. There's no need for evaluate():James Holmes 05/13/08 04:00 A >Eww. There's no need for evaluate():travis mitchell 05/13/08 10:39 A <cfdirectory directory="F:\MP3Music" name="Artists" sort="name ASC, size DESC" > <cfset artistList = valueList(Artists.name)> <cfset length=listlen(artistList)> <cfloop index="i" from="1" to="#length#"> <cfset Artist[i]=Artists.name[i]> </cfloop> <cfloop index="j" from="1" to="#length#"> <cfdirectory directory="F:\MP3Music\#Artist[j]#" name="Songs#j#" sort="name ASC"> </cfloop> <cfloop index="k" from="1" to="#length#"> <cfoutput> <h1>#Artists.name[k]#</h1> <br /> <cfloop query="Songs#k#"> <!-- right here I am needing to call a variable sort of like #Songs#k#.name#, but I have not found anything to work !--> </cfloop> </cfoutput> </cfloop> ANY HELP WOULD BE APPRECIATED!!! you can e-mail me at tmitchell.designs@gmail.com i will appreciate any help! #evaluate('Songs#k#.name')# ---------------------------------- William Seiter ColdFusion Web Developer / Consultant http://william.seiter.com Have you ever read a book that changed your life? Go to: http://www.winninginthemargins.com Use PassKey: GoldenGrove You'll be glad you did. ::-----Original Message----- :: ::Sent: Monday, May 12, 2008 10:56 PM ::To: CF-Talk ::Subject: defining variables in a new loop from an old loop :: ::<cfdirectory directory="F:\MP3Music" name="Artists" sort="name ASC, size ::DESC" > ::<cfset artistList = valueList(Artists.name)> ::<cfset length=listlen(artistList)> ::<cfloop index="i" from="1" to="#length#"> :: <cfset Artist[i]=Artists.name[i]> :: </cfloop> ::<cfloop index="j" from="1" to="#length#"> :: <cfdirectory directory="F:\MP3Music\#Artist[j]#" name="Songs#j#" ::sort="name ASC"> ::</cfloop> ::<cfloop index="k" from="1" to="#length#"> :: <cfoutput> :: <h1>#Artists.name[k]#</h1> :: <br /> :: <cfloop query="Songs#k#"> :: <!-- right here I am needing to call a variable sort of like ::#Songs#k#.name#, but I have not found anything to work !--> :: </cfloop> :: </cfoutput> ::</cfloop> :: :: :: ::ANY HELP WOULD BE APPRECIATED!!! you can e-mail me at ::tmitchell.designs@gmail.com i will appreciate any help! :: :: Eww. There's no need for evaluate(): <cfset tempQuery = VARIABLES["Songs" & k]> <cfloop query="tempQuery"> <cfoutput>#tempQuery.name#</cfoutput> </cfloop> or of course just use the column name, since we're inside a loop: <cfloop query="Songs#k#"> <cfoutput>#name#</cfoutput> </cfloop> On Tue, May 13, 2008 at 3:16 PM, William Seiter wrote: > #evaluate('Songs#k#.name')# -- mxAjax / CFAjax docs and other useful articles: http://www.bifrost.com.au/blog/ ----- Excess quoted text cut - see Original Post for more ----- I LOVE YOU ALL!! I'm self taught, and I'm still trying to get the hang of programming. THANKS SO MUCH!!
|
Mailing Lists
|
Latest Fusion Authority Articles
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||