Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

List delimiter problem.

Status
Not open for further replies.

cossiboon

Programmer
Dec 12, 2000
25
US
This is probably an easy question.
I am populating a list from an array using the arraytolist function. Then I go ahead and display the list using the cfloop tag. My delimiter is ~N~. When the items are displayed, I lose the first character if the first character of the item is in the delimiter.

My question: Is the delimiter limited to only one character for effective use?
I would rather use a delimiter longer than one character.

My code is attached.

Thanks for any help.



<cfset lstChoices = arraytolist(session.choices[session.currentquestionnumber],&quot;~N~&quot;)>
<cfloop list=&quot;#lstChoices#&quot; index=&quot;indChoices&quot;>


#indChoices#

</CFLOOP>


 
If you don't specify a Deliminater when working with lists it uses the default of &quot;,&quot;.

<CFSET lstChoices = ArryToList(SESSION.choices
Code:
[
SESSION.currentquestionnumber
Code:
]
,&quot;~N~&quot;)>

<CFLOOP LIST=&quot;#VARIABLES.lstChoices#&quot; INDEX=&quot;indChoices&quot; DELIMITERS=&quot;~N~&quot;>
#indChoices#
</CFLOOP> - tleish
 
Yes I relize that I do not have the delimiter specified in the previous post. Gauranteed, it's in my code. But Thanks.
 
Sorry. :) I tested the code with the deliminators... it seemed to work fine for me. It didn't remove any part of the string. Could you post a little more of you're code... perhaps examples of what is in the array you are referencing. - tleish
 
I tested it on 4.5 and it worked too. Would it be easier to loop through the array and not set it to a list at all? Don't know if that's possible with your application.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top