<html>
<head>
<link href="mmres://user_interface_reference.css" rel="stylesheet" type="text/css">
<title>ISDEFINED</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
   <div id="Description">
   <table cellpadding="0" cellspacing="0" border="0" width="100%" class="main">
      <tr> 
         <td valign="top" class="name">ISDEFINED</td>
         <td valign="top" nowrap class="compatibility">&nbsp;</td>
      </tr>
      <tr>
         <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
      </tr>


    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Description</span>
<p>
Evaluates a string value to determine whether the variable named in it exists. 
</p>

<p>
This function is an alternative to the ParameterExists function, which is deprecated.
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Returns</span>
<p>
True, if the variable is found, or, for a structure, if the specified key is defined; False, otherwise. 
</p>

<p>
The return value is False for an array or structure element referenced using bracket notation. For example, IsDefined(&quot;myArray[3]&quot;) always returns False, even if the array element myArray[3] has a value. 
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Category</span>
<p>
Decision functions
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Function syntax</span><pre>IsDefined(&quot;variable_name&quot;)
</pre>    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">See also</span>
<p>
Evaluate
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">History</span>
<p>
ColdFusion&#160;MX: Changed behavior: this function can process only the following constructs:
</p>
<ul>

<li>A simple variable </li>

<li>A named variable with dot notation</li>

<li>A named structure with dot notation (for example: mystruct.key)</li>
</ul>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Parameters</span>
<p>

</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Usage</span>
<p>
When working with scopes that ColdFusion exposes as structures, the StructKeyExists function can sometimes replace this function. The following lines are equivalent: 
</p>
<pre>if(isDefined(&quot;form.myVariable&quot;))
if(structKeyExists(form,&quot;myVariable&quot;))
</pre>    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Example</span><pre>&lt;cfif IsDefined(&quot;form.myString&quot;)&gt;
   &lt;p&gt;The variable form.myString has been defined, so show its contents.
   This construction allows us to place a form and its resulting action code
   on the same page and use IsDefined to control the flow of execution.&lt;/p&gt;
   &lt;p&gt;The value of &quot;form.myString&quot; is &lt;b&gt;&lt;i&gt;
   &lt;cfoutput&gt;#form.myString#&lt;/cfoutput&gt;&lt;/i&gt;&lt;/b&gt;
&lt;cfelse&gt;
   &lt;p&gt;During the first time through this template, the variable &quot;form.myString&quot; 
   has not yet been defined, so we do not try to evaluate it.
&lt;/cfif&gt;

&lt;form action=&quot;#CGI.Script_Name&quot; method=&quot;POST&quot;&gt;
&lt;input type=&quot;Text&quot; name=&quot;MyString&quot; value=&quot;My sample value&quot;&gt;
&lt;input type=&quot;Submit&quot; name=&quot;&quot;&gt;
&lt;/form&gt;
</pre>
         </td>
      </tr>
   </table>
   </div>
<div id="VARIABLE_NAME">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">VARIABLE_NAME</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>


<p>String, enclosed in quotation marks. Name of variable to test for.</p>

  </td>
  </tr>
  </table>
</div>

  </body>
</html>
