On Thu, Jul 17, 2008 at 10:58 AM, Kenny Kinds <[EMAIL PROTECTED]> wrote:

> greetings,
>
> I have some code that takes a string and breaks it into to components and
> set each component into a seperate variable.
>
> This code was set up to only take one string and perform this function.
>
> Now they want me allow the user to select multiple items from a select box
> which adds more values to my string and screws up my query.
>
> I tried looping through the code to seperat each value when it encounters a
> comma but it only processes the last item picked.
>
> I've tried using the ListGetAt finction but no luck.
>
> any thoughts?
>
> code:
> <cfset SelVal = trim(form.AppRegDS)><!---set Form variable-->
> <cfset qualifiedList1 = ListQualify(SelVal,",")>
>
> <cfloop list="#qualifiedList1#" index="ListElement" delimiters="'">
>
> <cfset position = Find("---",ListElement)><!-Look for this value>
> <cfset variable.App = Mid(ListElement,1, position-1)>
> <cfset variable.Region = Mid(ListElement,position+3,Len(ListElement))>



not sure what you're trying to do in your code.

what is the listQualify() meant to do?  if you're trying to create a comma
delimited list from a string, i'd use listChangeDelims() and change the
spaces to commas.  listQualify(), as you're using it, isn't going to give
you what you want.  you might want to try outputting your variables at
different points in the code to see that the values are what you're
expecting (i think they won't be).

another point to raise is that a string is already a list, just delimited
with a space instead of a comma.  really not much point in changing the
delims when you've got a workable list already.

also not at all sure why you're using a single quote as the delimiter in
your list-based cfloop?

might be easier if you show us what input you're receiving, and then show us
what the desired output/result should be?

-- 
A byte walks into a bar and orders a pint. Bartender asks him "What's
wrong?" Byte says "Parity error." Bartender nods and says "Yeah, I thought
you looked a bit off."


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:309240
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to