The idea someone else posted earlier, about having a "Initial" field in your
DB, and when you add a person to the list, to add their initial into this
field, is a great idea... but on TOP of that...

Query your user table, only selecting that "Initial" field. Then create a
list using ValueList(queryname.Initial).
Then when building your list of letters (I'm assuming you're doing a loop on
"65" to "90", those being the ASCII codes for the letters, then do a
ListFind on your list of initials for that character code. If you find
anything, make the letter a link - otherwise, don't. This is how I did the
very same thing you're talking about doing just a few weeks ago. It doesn't
matter if you have multiples of a particular initial in the list - just one
will trip the code.

One caveat - if your list gets HUGE then doing a list of ALL the initials
will get unwieldly... so consider the future. Perhaps set up a scheduled
task that runs once every once in a while, that queries the user table for
the initials, loops over the query and builds up a list of each initial with
one entry per, and store it in an application variable. Then when looping on
A to Z, do a ListFind on your app variable to see if that letter shows up.

----- Original Message -----
From: <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Friday, January 26, 2001 9:41 AM
Subject: Re: Alphabetic List


> Thanks for your replies.
>
> I think I didn't elaborate the question clearly.
>
> What I need is to output the list:
>
> All - 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 - Lists
>
> If there are persons last names start with "B", B should be a hot link.
> If there is no one's last name starts with "Q", Q is not clickable.
>
> Thanks!
>
> Hong
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to