If you want to see if it's a string you can use:

isValid("string",varToTest)


On Oct 19, 2006, at 5:51 PM, Charlie Arehart wrote:

Hi Leif. For those who don't recognize the name, Leif is the manager of the Atlanta Adobe User Group.
 
Leif, for your need, you say that what comes in is 2 UUIDs separated by a comma. That's called a "list" in CFML. Now, you say you want to test if it's a string. Do you mean you want to test if it's a list? Sadly, while there are several "decision functions" (isnumeric, isdate, etc.) there is neither isstring, islist, nor isUUID.
 
Now, as for separating the the list into an array, you can do that with listtoarray(). But if you just want be able to process the list of values individually, you don't *need* to put them into an array. You can loop over them, with CFLOOP LIST. You can also get at each list element using, funnily enough, ListGetAt, or any number of other "list functions". Yes, I'm pointing you to the docs, since there may be still other options you'd want to consider.
 
Finally, though, if you might be wanting to take this list of UUIDs (or any list) coming from a multiple select form field (or a checkbox) and use them in SQL, you may know you could use such a comma-separated list of values directly in SQL using the IN clause. But you may really be stumped in that you need to get single quotes around the individual elements, to change IN (item1, item2) to become IN ('item1','item2'). Here, CFML comes to the rescue again with a very often missed function called ListQualify (introduced in CF 4.01, which is why I think many missed it). So assuming your form field was ids, you could use IN (#listqualify(form.ids)#), and it would look like the last clause above when sent to SQL.
 
Is any of this close to what you needed? Sorry if I've gone off half-cocked. As always, I hope the info might help someone.  :-)
 
/charlie
 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Leif Wells
Sent: Thursday, October 19, 2006 5:01 PM
To: discussion@acfug.org
Subject: [ACFUG Discuss] Reading the results of a cfselect form element

All,

Sorry for the beginner's question (and my absence from this list and the meetings).

I have created a coldfusion file that has form that has a cfselect element. The multiple attribute is set to true.

When processing the form I get what I believe are two UUIDs separated by a comma. A String, I believe.

Question 1: How would test to see if this actually is a String?

Question 2: How do I convert this String to an Array? Or is there a better way to process a cfselect element?

Leif



-------------------------------------------------------------
To unsubscribe from this list, manage your profile @
http://www.acfug.org?fa=login.edituserform

For more info, see http://www.acfug.org/mailinglists
Archive @ http://www.mail-archive.com/discussion%40acfug.org/
List hosted by FusionLink
-------------------------------------------------------------
-------------------------------------------------------------
To unsubscribe from this list, manage your profile @
http://www.acfug.org?fa=login.edituserform

For more info, see http://www.acfug.org/mailinglists
Archive @ http://www.mail-archive.com/discussion%40acfug.org/
List hosted by FusionLink
-------------------------------------------------------------

Reply via email to