|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
parsing string variables using CF 4.1.xx
Hi,
I am passing id's for records that I want in the url. I have the id's delimeted by a "|". I can parse these using javascript, but I need to use each one so that I can have my query select only records with those ids. I am not familiar with cf string manipulating methods, and have not found a good solution yet. Anyone know a good way to get these record ids ? They are in this format: http://www.mysite.cfm?ids=1|2|4|7 Thanks for any input. |
|
#2
|
|||
|
|||
|
The easiest way is probably to treat it as a pipe-delimited list. Check the list functions in the docs.
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian. How to Post a Question in the Forums |
|
#3
|
|||
|
|||
|
Thanks for the input--I am glad there is a way.
I went to Macromedia, and searched google, but don't see a good tutorial for pipe-delimeted list methods in ColdFusion. How do I get started using this method? |
|
#5
|
|||
|
|||
|
How about if I wanted to do a foreach id in #listGetAt( url.ids)# type of application.
What method/procedure call be that would work for that? |
|
#6
|
|||
|
|||
|
<cfset idsNumber = ListValueCount(url.ids,"|")> isn't working for me either.
I just need to be able to count and identify the number of id's that I have in the URL that are separated by the "|" character. |
|
#7
|
|||
|
|||
|
OK -- I'm set.
I used the code you sent and some googling to figure out how to convert the url.ids to an array with ListToArray(). Now I can just index through the array using a for loop and #ArrayLen# of my array. Thanks for input. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > parsing string variables using CF 4.1.xx |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|