Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

cannont convert to boolean

New Here ,
Feb 10, 2009 Feb 10, 2009
I have the following code below that I'm using to create an if statement from a list of agentsines. the user enters 22,23,75,13,42, etc as the 'Agents' variable and I want to translate it to
<cfset IfStatement = "bkagtid EQ '22' OR bkagtid EQ '23' OR bkagtid EQ '75' OR bkagtid EQ '13' OR bkagtid EQ '42'">
and then use something like <cfif #ifstatement#>
when I do that I get an error that says
"cannot convert the value "bkagtid EQ '22' OR bkagtid EQ '23' OR bkagtid EQ '75' OR bkagtid EQ '13' OR bkagtid EQ '42'" to a boolean "

Any ideas on if this is possible?

Thanks
357
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 10, 2009 Feb 10, 2009
Nevermind, I used the ListFind function and was able to get it to work using that.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 10, 2009 Feb 10, 2009
LATEST
One cannot "build" CFML source code at run time, which is what you're
trying to do here. CFML is compiled (to bytecode, but still compiled)
before it's executed, so any CFML has to be syntactically complete at
*compile time*. It's not the CFML that's executed, it's the bytecode.

You need to revise your logic accordingly.

--
Adam
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources