Hi Alex, try this one (allthough) I do not understand the problem:
<cfset emailList = ValueList(getemail.email)> <cfif GetEmail.RecordCount IS 1> <cfset email1=#trim(ListFirst(emaillist))#> <cfelseif getemail.Recordcount is 2> <cfset email1=#trim(listGetAt(emaillist, 1))#> <cfset email2=#trim(listGetAt(emaillist, 2))#> <cfelse> <cfset email1=#trim(listGetAt(emaillist, 1))#> <cfset email2=#trim(listGetAt(emaillist, 2))#> <cfset email3=#trim(listGetAt(emaillist, 3))#> .... BUT: you can always access a certain record like follows: <cfset eMail = getemail.email[recordnumber]> so to solve the above, just do something like follows: <cfloop query="getemail"> <cfset SetVariable("email" & getemail.currentrow, getemail.email[getemail.currenrow])> </cfloop> Allthough in my opinion it makes no sense to set variables like that (I mean email1, email2 etc...) Gert Greetings from Switzerland Gert Franz Railo Technologies GmbH [EMAIL PROTECTED] www.railo.ch Join our Mailing List german: http://de.groups.yahoo.com/group/railo/ english: http://groups.yahoo.com/group/railo_talk/ linked in: http://www.linkedin.com/e/gis/71368/0CF7D323BBC1 alex poyaoan schrieb: > Hi everybody.. havinng a problem with listgetat and couldn't seem to find the > solution.. please help my code is > > <cfif GetEmail.RecordCount IS 1> > <cfset emaillist=#getemail.email#> > <cfset email1=#trim(ListFirst(emaillist))#> > > <cfelseif getemail.Recordcount is 2> > <cfset emaillist=#getemail.email#> > <cfset email1=#trim(listGetAt(emaillist, 1))#> > <cfset email2=#trim(listGetAt(emaillist, 2))#> > <cfelse> > <cfset emaillist=#getemail.email#> > <cfset email1=#trim(listGetAt(emaillist, 1))#> > <cfset email2=#trim(listGetAt(emaillist, 2))#> > <cfset email3=#trim(listGetAt(emaillist, 3))#> > > > I have a query getemail with one email only it goes okey if two or three it > throws these error Invalid list index 2. > In function ListGetAt(list, index [, delimiters]), the value of index, 2, is > not a valid as the first argument (this list has 1 elements). Valid indexes > are in the range 1 through the number of elements in the list. > > The error occurred in > C:\CFusionMX7\wwwroot\devcurianet\riservate\socialMail\subscriberForm.cfm: > line 60 > > 58 : <cfset emaillist=#getemail.email#> > 59 : <cfset email1=#trim(listGetAt(emaillist, 1))#> > 60 : <cfset email2=#trim(listGetAt(emaillist, 2))#> > > ...... > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:303274 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4