Because you're setting the variable to a blank value.

The variable name is testVar, and you specifically set <cfset testVar = ""> 
before checking the value.

Name it something else and it'll work.

On Tuesday, November 17, 2015 at 6:33:12 PM UTC-5, Jason Allen wrote:
>
> *Hi Guys, *
>
> *I'm getting what I think is strange behavior. *
>
> *I'm building a function.  *
>
> *  <cffunction name="testFunction" returntype="struct" output="no" 
> access="remote" returnformat="json">*
>   
> *    <cfargument name="testVar" type="numeric" required="false" default="" 
> hint="" />*
> * <cfset var test=StructNew()>*
> * <cfset test.originalTest = "#arguments.testVar#">*
> * <cfset test.originalTestTrim = "#trim(arguments.testVar)#">*
> * <cfset test.testVar = "">*
> * <cfset testVar = "">*
> * <!--- test --->*
> * <cfif trim(arguments.testVar) eq ''>*
> *  <cfset testVar = "woops">*
> * </cfif>*
>
> *        <cfset test.testVar = "#testVar#">*
> *  <cfsetting showdebugoutput="false" />*
>
> *    <cfreturn test>*
>
> *  </cffunction>*
>
>
> *The part I'm having trouble with is*
>
> *<cfif trim(arguments.testVar) eq ''>*
>
> *Even though I've supplied the argument 'arguments.testVar' and it is a 
> recongized value (able to assign value to test.oroginalTest, *
> *the if statement is returning true and setting testVar to 'woops'. *
>
> *What am I missing? *
>

-- 
-- 
online documentation: http://openbd.org/manual/
 http://groups.google.com/group/openbd?hl=en

--- 
You received this message because you are subscribed to the Google Groups "Open 
BlueDragon" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to