how to detect if string is true or false

223 views Asked by At

Ive recently been advised we appear to have a bug in a script we put together many years ago.

Basically its for an import utility that reads in quite a lot of data.

We basically leverage the java POI utliity to read in a spreadsheet, and we are appearing to have issue with true false statements.

<cfif Evaluate("GetobjSheet.Query.#sysArray[26][5]#")>1<cfelse>0</cfif>

This appears to work correctly when the string true or false is present, but occasionally we find people are forgetting to enter in the value.

is there a function within Coldfusion that will automatically treat empty strings or strings that dont validate to true automatically as false ?

thanks in advance

1

There are 1 answers

2
duncan On

I'd simply do

<cfif len(GetobjSheet.Query[sysArray[26][5]]) AND GetobjSheet.Query[sysArray[26][5]]>
1
<cfelse>
0
</cfif>