I have been coming across this issue more and more when dealing with
JavaScript and JSON which is ColdFusion changing true|false to YES|NO
values.

 

For example:-

 

<cfset foo = true />

<cfoutput>#foo#</cfoutput> = true

 

<cfset foo = !foo />

<cfoutput>#foo#</cfoutput> = NO

 

Now take this JSON string for example

 

{"foo":#foo#} would then become {"foo":NO} which then screws everything up

 

I posted a feature request on the adobe site to have a toBoolean() function
which would return only true or false based on the argument

 

So then we would be able to have...

 

{"foo":#toBollean(foo)#} which would output as {"foo":false}

 

What are the thoughts here.  I was very surprised to see the lack of this
function in the library actually.

 

Also can anyone one recommend a way to do this now? I tried
JavaCast("Boolean", foo) but that didn't work.

 

Steve

-- 
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en.

Reply via email to