> ARRRGGGHH.... I would like to have my cfloop  manage the 
> variable regardless of  how many items (more than zero) are 
> in the list. Is there a way an elegant method of
> checking the contents if my list besides if form.foo neq '' 
> and listlen(form.foo) eq 0 ?.....
> 
> IsList() is a function long overdue to CF....

Well, okay, but I never had a use for this that I can think of...

<cfscript>
function IsList(list) {
        if (arguments[2] EQ "") arguments[2] = ",";
        if (ListLen(arguments.list,arguments[2]) GT 1) return TRUE;     
        return FALSE;
}
</cfscript>

<cfset variables.A = "Apple">
<cfset variables.B = "Apple,Orange,Lemon">

<cfoutput>
<p>A is a list: #IsList(variables.A)#</p>
<p>B is a list: #IsList(variables.B)#</p>
</cfoutput>


By the way, you can pass in delimiters just like you can with regular list
functions, but the default delimiter is (shock) a comma, so you don't have
to pass one in that case.

Andy



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:259382
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to