Skip to main content
Inspiring
November 13, 2007
Question

<CFIF NOT VariableName>

  • November 13, 2007
  • 3 replies
  • 432 views
Does <CFIF NOT VariableName> the same as <CFIF isDefined("VariableName")> Or it is checking if VariableName is 0 ?

This topic has been closed for replies.

3 replies

Inspiring
November 13, 2007
quote:

Originally posted by: mega_L
Does <CFIF NOT VariableName> the same as <CFIF isDefined("VariableName")> Or it is checking if VariableName is 0 ?



Try them both without setting the variable first and see what happens.
Inspiring
November 13, 2007
> Does <CFIF NOT VariableName> the same as <CFIF isDefined("VariableName")>

No

<CFIF NOT VariableName> assumes the variable does exist. The CFIF then checks if the value of #VariableName# equates to false

Inspiring
November 13, 2007
mega_L wrote:
> Does <CFIF NOT VariableName> the same as <CFIF isDefined("VariableName")> Or it is checking if VariableName is 0 ?

The latter, it is a short cut version of <cfif VariableName NEQ 0>