Hopefully it'll be after my shelf-life is long gone :P

sas

Scott A. Stewart, 
Web Application Developer
 
Engineering Consulting Services, Ltd. (ECS)
14026 Thunderbolt Place, Suite 300
Chantilly, VA 20151
Phone: (703) 995-1737
Fax: (703) 834-5527


-----Original Message-----
From: Ewok [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 19, 2005 02:41 pm
To: CF-Talk
Subject: RE: Anyone know of a more elegant way to do this?
Importance: Low

No problem (and good luck) Let us know if you shut the doors when you hit
999999ZZ :^O

-----Original Message-----
From: SStewart [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 19, 2005 9:11 AM
To: CF-Talk
Subject: RE: Anyone know of a more elegant way to do this?

Ewok...

This works, 

Thanks

sas

Scott A. Stewart, 
Web Application Developer
 
Engineering Consulting Services, Ltd. (ECS)
14026 Thunderbolt Place, Suite 300
Chantilly, VA 20151
Phone: (703) 995-1737
Fax: (703) 834-5527


-----Original Message-----
From: Ewok [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 18, 2005 06:03 pm
To: CF-Talk
Subject: RE: Anyone know of a more elegant way to do this?
Importance: Low

Sorry, first one didn�t come through I guess... here it is again

This doesn�t take into account that you may reach ZZ will you actually have
that many on one project? It seems like it would throw your whole numbering
out of whack if so anyway. I definitely agree with Claude (Im sure you do
too) but if you can manage to start with a new schema it would save a lot of
future headache... like actually having 01000AA - 01000ZZ and needing
another since the number seems to be more of a main project indicator and
the letters revisions or changes/updates... anyway... 

This will increment the letters AA - AZ and roll AZ to BA. It's by no means
perfect either but it's not 1000 lines of code :)


<cfquery name="jobnum" datasource="mydsn" maxrows="1">
select * from q order by jobid desc
</cfquery>

<cfset alpha = "A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z">

<cfset LastJobNumber = jobnum.jobnumber>

<cfset FirstLetter = ucase(left(right(LastJobNumber, 2), 1))>
<cfset LastLetter = ucase(right(ucase(LastJobNumber), 1))>
<cfset NumberPrefix = rereplace(LastJobNumber, "[^0-9]", "", "ALL")>

<cfif LastLetter is "Z">
        <cfset NewLastLetter = "A">
        <cfset IncrementFirst = true>
<cfelse>
        <cfset LastLetterPosition = ListFind(alpha, LastLetter)>
        <cfset NewFirstLetter = FirstLetter>
        <cfset NewLastLetter = ListGetAt(alpha, LastLetterPosition+1)>
        <cfset IncrementFirst = false>
</cfif>

<cfif IncrementFirst>
        <cfset FirstLetterPosition = ListFind(alpha, FirstLetter)>
        <cfset NewFirstLetter = ListGetAt(alpha, FirstLetterPosition+1)>
</cfif>

<cfoutput>#NumberPrefix##NewFirstLetter##newLastLetter#</cfoutput>


-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.11.12 - Release Date: 5/17/2005
 








~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:207204
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