Here it is not in pseudo-code:
<cfquery datasource="#request.dsn#" name="qGetAlphaIndex">
SELECT DISTINCT(UPPER(Left(column_name,1))) AS First_Letter
FROM table_name
ORDER BY First_Letter ASC
</cfquery>
This version shows only active letters:<br>
<cfoutput query="qGetAlphaIndex">
<cfif ReFindNoCase("[a-zA-Z]",First_Letter)>
<a href="mypage.cfm?L=#First_Letter#">#First_Letter#</a>
<cfif qGetAlphaIndex.CurrentRow NEQ
qGetAlphaIndex.RecordCount> | </cfif>
</cfif>
</cfoutput>
<br><br>
This version shows the entire alphabet with the active letters
hyperlinked:<br>
<cfset i=65>
<cfoutput>
<cfloop condition="i LTE 90">
<cfif ListFind(valuelist(qGetAlphaIndex.First_Letter),chr(i))>
<a href="mypage.cfm?L=#chr(i)#">#chr(i)#</a>
<cfelse>
#chr(i)#
</cfif>
<cfif i NEQ 90> | </cfif>
<cfset i=i+1>
</cfloop>
</cfoutput>
Joshua Miller
Head Programmer / IT Manager
Garrison Enterprises Inc.
www.garrisonenterprises.net
[EMAIL PROTECTED]
(704) 569-0801 ext. 254
************************************************************************
*************
Any views expressed in this message are those of the individual sender,
except where the sender states them to be the views of
Garrison Enterprises Inc.
This e-mail is intended only for the individual or entity to which it is
addressed and contains information that is private and confidential. If
you are not the intended recipient you are hereby notified that any
dissemination, distribution or copying is strictly prohibited. If you
have received this e-mail in error please delete it immediately and
advise us by return e-mail to [EMAIL PROTECTED]
************************************************************************
*************
-----Original Message-----
From: Tim Blair [mailto:[EMAIL PROTECTED]
Sent: Monday, September 01, 2003 8:02 AM
To: CF-Talk
Subject: RE: Okay, what's the first part of those alphabetical
navigation strips?
> Okay, I've got almost ALL the parts in place. But there's ONE
> LAST part that I'm having trouble with. It's the expression
> to check for the existance of an entry.
I posted some pseudo-code the other day of how you'd accomplish this,
but don't know if it came through. Repost...
<!--- get "linked" letters from DB --->
<query name="letters">
SELECT DISTINCT(Left(your_column_name,1)) AS alpha
FROM your_table_name
WHERE your_clause
</query>
<!--- get letters that need links in to a list --->
<set linked = valuelist(letters.alpha)>
<!--- loop through a to z --->
<loop from="a" to="z" index="letter">
<!--- check "current" letter is in list of "linked" ones --->
<if listfind(linked, letter)>
<!--- letter that needs linking --->
<a href="...">#letter#</a>
<else>
<!--- no link --->
#letter#
</if>
</loop>
Tim.
-------------------------------------------------------
RAWNET LTD - Internet, New Media and ebusiness Gurus.
Visit our new website at http://www.rawnet.com for
more information about our company, or call us free
anytime on 0800 294 24 24.
-------------------------------------------------------
Tim Blair
Web Application Engineer, Rawnet Limited
Direct Phone : +44 (0) 1344 393 441
Switchboard : +44 (0) 1344 393 040
-------------------------------------------------------
This message may contain information which is legally
privileged and/or confidential. If you are not the
intended recipient, you are hereby notified that any
unauthorised disclosure, copying, distribution or use
of this information is strictly prohibited. Such
notification notwithstanding, any comments, opinions,
information or conclusions expressed in this message
are those of the originator, not of rawnet limited,
unless otherwise explicitly and independently indicated
by an authorised representative of rawnet limited.
-------------------------------------------------------
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Your ad could be here. Monies from ads go to support these lists and provide more
resources for the community.
http://www.fusionauthority.com/ads.cfm