Is this what you need?
Query1
Well just use the recordcount for your ending loop value IE: from="1"
to ="#myQuery.recordCount#".
Not sure about the index of the array, are you saying you want to use a
non numeric value for the index? I would think that this would cause
problems in sorting the array for future use and manipulation. I would
use the #currentrow# instead, and then use substring(yourdata,1,1) in
your query to pull the first digit or alpha character and sort it DESC.
Then use it as another element in the array.
IE
> arUsers = new Array();
> arUsers["1"] = new Array ("A",".mobius", "//twitch", "_Rand_");
> arUsers["2"] = new Array ("B","abcfob11", "abovewood",
"acid_tongued_devil");
> arUsers["3"] = new Array ("C","BA", "badblood", "Banal");
> arUsers["4"] = new Array ("D","CAAB", "Caffeine Slug", "Calphor");
.
There are two major products that come out of Berkeley: LSD and [Unix]
BSD. We don't believe this to be a coincidence.
Doug Brown
----- Original Message -----
From: "Pete Ruckelshaus" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Monday, February 04, 2002 5:09 AM
Subject: Help! Building a dynamic JS array with over 1100 elements
> OK, here's the deal. I'm implementing a JavaScript user lookup
> (http://users.andassoc.com/gibbs/beerology.html is a static mockup and
the
> real site is at http://www.beerology.com/ars/) and I can't think of
the best
> way to get started. The current implementation of just a select box
has
> loading issues, and this JavaScript loads much mroe quickly and
effectively.
> Here's what I have to work with... I am using Cold Fusion 5
Enterprise,
> first of all, so I can use query of queries and UDF's. I also have a
the
> results of a query available that grabs all users (query is in
> application.cfm file since I use it a lot):
>
> code:
>
-------------------------------------------------------------------------
---
> ----
> <CFQUERY name="getUsers" datasource="#REQUEST.dbLoc#"
dbtype="OLEDB"
> provider="Microsoft.Jet.OLEDB.4.0" providerdsn="#REQUEST.dbLoc#"
> username="admin" password=""> SELECT DISTINCT ArsID FROM tblUsers
ORDER BY
> ArsID</CFQUERY>
>
-------------------------------------------------------------------------
---
> ----
>
> Again, this gives me all ArsID's. I need to build something like this:
>
> code:
>
-------------------------------------------------------------------------
---
> ----
> arUsers = new Array();
> arUsers["#"] = new Array (".mobius", "//twitch", "_Rand_");
> arUsers["A"] = new Array ("abcfob11", "abovewood",
"acid_tongued_devil");
> arUsers["B"] = new Array ("BA", "badblood", "Banal");
> arUsers["C"] = new Array ("CAAB", "Caffeine Slug", "Calphor");
> ETC...all the way to Z, and with dozens of user ID's for each letter
of the
> alphabet, plus some userID's that don't begin with an alpha character
>
-------------------------------------------------------------------------
---
> ----
>
> There are well over 1,000 users, which has been growing steadily, so
this
> needs to be a reasonably efficient bit of coding, which takes looping
and
> running 27 queries out of the picture.
>
> Off the top of my head, I know I can create a list out of all of the
users
> then go in and grab each list element that begins with each letter of
the
> alphabet (thus creating a new list) and use that list to build the
> JavaScript array, but that would be a pretty laborious process. I'd
love to
> loop through somehow, but you need numeric values for the from and to
> attributes of the cfloop tag. Can any CF experts out there think of a
more
> elegant approach to this problem?
>
> Thanks
>
> Pete
>
>
______________________________________________________________________
Why Share?
Dedicated Win 2000 Server � PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
Instant Activation � $99/Month � Free Setup
http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists