[thelist] [CF] Value of a url var with no value

Bimal Shah bimal.shah at venus.co.uk
Tue Jul 31 09:27:30 CDT 2001


I think there is a general problem (issue?) with CF list management, that
is as Raymond pointed out to do with CF not handling lists with empty
elements.

The following extract of a custom tag we wrote gets around the
problem by padding out the empty elements with a space character.
It works by checking if an empty elements exist as a first, last or
inbetween a list.

<cfset attributes.values = "tom,,dick,">
<!--- We want to interpret the above as having 4 elements --->

<cfset delim = ",">

<cfif left(attributes.values,1) eq "#delim#">
	<cfset attributes.values = "#delim# #attributes.values#">
</cfif>

<cfif right(attributes.values,1) eq "#delim#">
	<cfset attributes.values = "#attributes.values# #delim#">
</cfif>

<cfset attributes.values=Replace(attributes.values,"#delim##delim#","#delim#
#delim#","ALL")>

<!--- attributes.value should equal to [tom, ,dick, ,] --->

And then you can get each element if you get a space character, you know it
is an
empty element and can handle it accordingly.

---
Bimal Shah (Senior Web Developer)
(T) 020 7240 5858 (F) 020 7240 5859
(E) bimal at venus.co.uk
Venus Internet Limited http://www.venus.co.uk

---------------------------------------
For unsubscribe and other options, including
the Tip Harvester and archive of TheList go to:
http://lists.evolt.org Workers of the Web, evolt !





More information about the thelist mailing list