I have a CFC function that is returning a data type of string but the
Len() function says its a complex data type and errors out.

As far as I can tell from various different CF solutions getting the
length of string is simply done by wrapping the string or function
returning a string in the Len() method call. I've even tried to cast
it using javaCase("string",variable) with out success. Says unknown
data type.

Any help on this would be appreciated. Thanks

Lionel




This is the function from the CFC

        <cffunction name="GetHelp" returntype="string" output="false">
                <cfset VAR ThisHelp = "">
                <cfset VAR ThisPGFN = "">

                <cfif IsDefined("pgfn")>
                        <cfset ThisPGFN = pgfn>
                </cfif>

                <cfquery name="qry1" datasource="#variables.instance.ds#">
                        SELECT ID, Content
                        FROM #variables.instance.database#.Member_Help
                        WHERE PageName = <cfqueryparam 
cfsqltype="cf_sql_varchar"
value="#ListLast(CGI.SCRIPT_NAME, "/")#" maxlength="32"> AND
                                  <cfif ThisPGFN GT "">
                                          pgfn LIKE <cfqueryparam 
cfsqltype="cf_sql_varchar"
value="%#ThisPGFN#%" maxlength="32"> AND
                                  <cfelse>
                                          pgfn = "" AND
                                  </cfif>
                                  application_ID = <cfqueryparam 
cfsqltype="cf_sql_integer"
value="#this.application_ID#">
                                  LIMIT 1
                </cfquery>
                <cfif qry1.RecordCount GT 0>
                        <cfset ThisHelp = qry1.Content>
                <cfelse>
                        <cfquery name="qry2" 
datasource="#variables.instance.ds#">
                                SELECT ID, Content
                                FROM #variables.instance.database#.Member_Help
                                WHERE PageName = <cfqueryparam 
cfsqltype="cf_sql_varchar"
value="#ListLast(CGI.SCRIPT_NAME, "/")#" maxlength="32"> AND
                                          <cfif ThisPGFN GT "">
                                                  pgfn LIKE <cfqueryparam 
cfsqltype="cf_sql_varchar"
value="%#ThisPGFN#%" maxlength="32"> AND
                                          <cfelse>
                                                  pgfn = "" AND
                                          </cfif>
                                          application_ID = <cfqueryparam 
cfsqltype="cf_sql_integer"
value="0">
                                          LIMIT 1
                        </cfquery>
                        <cfif qry2.RecordCount GT 0>
                                <cfset ThisHelp = qry2.Content>
                        </cfif>
                </cfif>
                <cfif ThisHelp GT "">
                        <cfsavecontent variable="ThisHelp">
                                <div id="overlay-help" style="visibiliy: 
hidden;">
                                        <div class="bd">
                                         <cfoutput>#ThisHelp#</cfoutput>
                                        </div>
                                  </div>
                        </cfsavecontent>
                </cfif>
                <cfreturn ThisHelp>
        </cffunction>

-- 
online documentation: http://openbd.org/manual/
   google+ hints/tips: https://plus.google.com/115990347459711259462
     http://groups.google.com/group/openbd?hl=en

Reply via email to