First, if paginefuoricollana is from a query that always runs, then it is
always defined; it just might be empty. Unless your query is in a cfif
somewhere or cfcase... then there is no need for the isdefined()

Second, I don’t see where you are looping over any query results. Are you
trying to just output one record or many? Posting your query here would
help.

If it is just one record and you are not looping over the query, you would
need to scope the column name with the query's name... like... 

MyQueryname.paginefuoricollana (MyQuery being whatever you used in the
'name' attribute of your cfquery)

So if you are just trying to output a single record, try this.

<cfif len(trim(myquery.paginefuoricollana))>, p
</<cfif>#myquery.paginefuoricollana#

If you are trying to output more than one record, try this...

<cfoutput>
 <cfloop query="myquery">
  <cfif len(trim(paginefuoricollana))>, p </<cfif>#paginefuoricollana#<br />
 </cfloop>
</cfoutput>

If neither of those prints anything out then there were most likely no
results from the query. You can check that with a cfdump:

<cfdump var="#myquery#" />

If there is an error, well... that’s a different story and I'd need to see
what it was.

Let us know how that goes.


-----Original Message-----
From: alex poyaoan [mailto:[EMAIL PROTECTED] 
Sent: Thursday, October 19, 2006 3:16 AM
To: CF-Talk
Subject: help on printing a string depending on zero length or not

hi everybody need help on this tried this code and didn't work the thing is
a cfif that evaluates a field from a database if not null it prints the
comma, and a letter p before the field which i declared. otherwise it does
nothing... 
here's the code...
 

<cfoutput>

<cfset comma=",">
        <cfset p="p">

        <cfif isDefined("paginefuoricollana") and len(paginefuoricollana)>
                <cfset file = "#comma# #p# #paginefuoricollana#">
        <cfelse>
                <cfset file = "#paginefuoricollana#">
        </cfif>


        <td>#file#</td>

</cfoutput>

thanks 
alex



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:257345
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