<cfset cfList = REReplaceNoCase( cfList, ",[[:space:]]*,",NO VALUE
STRING,", "ALL" ) />

That should do the trick

  _____  

From: Chunshen (Don) Li [mailto:[EMAIL PROTECTED]
Sent: 30 June 2004 15:27
To: CF-Talk
Subject: The infamous LIST again!

SET LIST VALUE:
<cfset cfList = "a,b,,d">

<cfloop index="e" list="#cfList#">
<cfoutput>
#e#
</cfoutput>
</cfloop>

Three out of the above FOUR list elements would be displayed.
No, my application requires more complexity than the above example.  The
point is, I need a "NO VALUE STRING" for the third element even if it's
EMPTY instead of conveniently ignoring it.  An attempt to convert the
list to an Array,

<cfset cfList = "a,b,,d">
<cfset anArray4List = ListToArray(cfList)>

<cfset cnt = 0>
for argument sake, use plain 4 items here
<cfloop index="e" from=1 to=4>
<cfset cnt = cnt + 1>
<cfoutput>
#anArray4List[cnt]#
</cfoutput>
</cfloop>

Failed to achieve what is intended.  It seems that the ListToArray
function converts the 3 elements to an array.

What's your way to circumvent this problem?

TIA.

  _____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to