Skip to main content
Participating Frequently
July 11, 2008
Question

Passive errors?

  • July 11, 2008
  • 1 reply
  • 192 views
In PHP, I know that if you echo or display a variable that has not been defined, it will just run through it and display nothing. However, in CF, I get an error when that happens. If have about 20 variables that need to be displayed and need to know if there's a way to have the code say, if these variables are not defined, just ignore them. Possible? Thanks!

Ryan
    This topic has been closed for replies.

    1 reply

    Inspiring
    July 11, 2008
    no, cf will always throw an error if you try to use an un-defined variable.
    you can use <cfparam> to give your vars default values - if a var is not
    defined, it will be set to the value you specify; if it is defined, it
    will not be changed.

    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com/