Yes. Thanks

At 01:33 PM 8/14/01 -0400, you wrote:

>The following statements
>
>                    ListFirst:[#dircount1.type#]#ListFirst(temp)#<br>
>                    ListLast: [#dircount1.type#]#ListLast(temp)#
>
>are in a <cfoutput> with no query parameter, and outside of the <cfloop>.
>Therefore they will both refer to the value of type in the first record of
>the query dircount. (that's why they both showed dir even though the last
>value was a file)
>
>I haven't plowed through all your more recent code, but does this help?
>
>Sheila Handler
>jdt technologies, ltd.
>
>
>==================================
>You wrote:
>  For some reason the code below lists the last file in the listing as a
>  directory even though it is a file?
>
>  Try it out. Make sure you have some text files in your root directory.
>
>  <cfparam name="dir" default="d:\">
>
>  <cfoutput>
><CFDIRECTORY ACTION="LIST" DIRECTORY="#dir#" NAME="test">
>
><cfset testCount = 0>
><cfloop query="test">
><cfset temp = ValueList(test.name)>
><cfif type eq "Dir">
>            <cfset testCount = testCount + 1>
>   Count: [#test.type#][#testCount#]<br>
>      </cfif>
></cfloop>
>
>   ListFirst: [#test.type#]#ListFirst(temp)#<br>
>   ListLast: [#test.type#]#ListLast(temp)#
></cfoutput>
>
>
>This is my output:
>
>Count: [Dir][1]
>Count: [Dir][2]
>Count: [Dir][3]
>Count: [Dir][4]
>Count: [Dir][5]
>Count: [Dir][6]
>Count: [Dir][7]
>Count: [Dir][8]
>ListFirst:[Dir] books
>ListLast: [Dir] filename.txt
>
>Note the file type on the ListLast output??
>
>It *should* read LstLast: [File] filename.txt
>
>What am I doing wrong?
>
>
>
>
>
>Hi Craig,
>
>Your code worked great. I'm still having trouble incorporating the code
>into the DIRLIST query. It ALWAYS returns the value "8".
>I need the directories in the DIRLINK query to increment so I can can check
>against the previous loop (dircount1) and set the appropriate graphic for
>the first entry, remaining entries and last entry simulating an Explorer
>like menu.
>
>First entry graphic would be a closing plus with bottom rule. (dir1)
>Remaining entries would be an open plus with rules top/bottom. (dir2 to
>dir7)
>Last entry graphic would be a closing plus with top rule. (dir8)
>
>I'm not sure I'm making sense. :-)
>
>This is the output from the code below.
>
>Count: [Dir][1] [dir1]
>Count: [Dir][2] [dir2]
>Count: [Dir][3] [dir3]
>Count: [Dir][4] [dir4]
>Count: [Dir][5] [dir5]
>Count: [Dir][6] [dir6]
>Count: [Dir][7] [dir7]
>Count: [Dir][8] [dir8]
>ListFirst:[Dir]dir1
>ListLast: [Dir]dir8
>
>dir1
>dir2
>dir3
>dir4
>dir5
>dir6
>dir7
>dir8
>
>
>
>Below is is your snippet along with my <CFDIRECTORY
>
>
><!--- set indent --->
><cfset indent = "&nbsp;&nbsp;&nbsp;">
>
>Count: [#dircount1.type#][#loopCount1#] [#name#]
>ListFirst:[#dircount1.type#]#ListFirst(temp)#
>ListLast: [#dircount1.type#]#ListLast(temp)#
>#indent# 66aeff7.jpg 66af083.jpg  #name#
>
>
>
>
>
>
>
>FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
>Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
>Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to