Use <cfset cflist = replace(cfList,',,',',$$,','ALL')> to replace two comas
next to each other with ,$$, or any other recognisable pattern that will not
occur in real situations (,NULL, for example).  This will change your list
into

a,b,$$,d

And you can then process the replaced string later in your code depending on
what you are doing with the list.

--
Jay

> -----Original Message-----
> 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