<cfdirectory directory="d:\mydirectoryfullofiles\" name="qryFiles">
<cfset highest = 0>
<cfloop query="qryFiles" startrow="1">
<cfset currentVal = val(replaceNoCase(name,"file","","ONE"))>
<cfset highest = max(currentVal,highest)>
</cfloop>

The value that highest is set to at the end of this is your highest integer.

----- Original Message ----- 
From: "Ian Skinner" <[EMAIL PROTECTED]>
To: "CF-Talk" <[email protected]>
Sent: Thursday, October 19, 2006 9:29 PM
Subject: Find last file.


>I have an app that writes out a file that is named with consecutive 
>numbers, i.e. file01, file02, file04.  The numbers are actually based on 
>the date the file is written.  What I'm looking for is an easy way to find 
>the last file written, the one with the highest integer appended to the 
>file name.
>
> Can anybody help my muddled mind?
>
> TIA
>
>
> --------------
> Ian Skinner
> Web Programmer
> BloodSource
> www.BloodSource.org
> Sacramento, CA
>
> ---------
> | 1 |   |
> ---------  Binary Soduko
> |   |   |
> ---------
>
> "C code. C code run. Run code run. Please!"
> - Cynthia Dunning
>
> Confidentiality Notice:  This message including any
> attachments is for the sole use of the intended
> recipient(s) and may contain confidential and privileged
> information. Any unauthorized review, use, disclosure or
> distribution is prohibited. If you are not the
> intended recipient, please contact the sender and
> delete any copies of this message.
>
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:257390
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to