<html>
<head>
<link href="mmres://user_interface_reference.css" rel="stylesheet" type="text/css">
<title>STRUCTGET</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">STRUCTGET</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>
Gets a structure(s) from a specified path. 
</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>
An alias to the variable in the pathDesired parameter. If necessary, StructGet creates structures or arrays to make pathDesired a valid variable &quot;path.&quot;
</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>
Structure 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>StructGet(pathDesired) 
</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>
Structure functions; "Modifying a ColdFusion XML object" in Chapter&#160;35, "Using XML and WDDX," in ColdFusion MX Developer's Guide
</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:
</p>
<ul>

<li>Changed behavior: this function can be used on XML objects.</li>

<li>Changed behavior: if there is no structure or array present in pathDesired, this function creates structures or arrays to make pathDesired a valid variable &quot;path.&quot;</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>
You can inadvertently create invalid structures using this function. For example, if array notation is used to expand an existing array, the specified new element is created, regardless of the type currently held in the array.
</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">Example</span><pre>&lt;!--- GetStruct() test ---&gt;
&lt;cfset test = StructGet( &quot;dog.myscope.test&quot; )&gt;
&lt;cfset test.foo = 1&gt; 
&lt;cfif NOT IsDefined(&quot;dog&quot;)&gt;
   Dog is not defined&lt;br&gt;
&lt;/cfif&gt;
&lt;cfif NOT IsDefined(&quot;dog.myscope&quot;)&gt;
   Dog.Myscope is not defined&lt;br&gt;
&lt;/cfif&gt;
&lt;cfif NOT Isdefined(&quot;dog.myscope.test&quot;)&gt;
   Dog.Myscope.Test is not defined&lt;br&gt;
&lt;/cfif&gt;
&lt;cfif NOT Isdefined(&quot;dog.myscope.test.foo&quot;)&gt;
   Dog.Myscope.Test.Foo is not defined&lt;br&gt;
&lt;/cfif&gt;
&lt;cfoutput&gt;
   #dog.myscope.test.foo#&lt;br&gt;
&lt;/cfoutput&gt;
&lt;cfset test = StructGet( &quot;request.myscope[1].test&quot; )&gt;
&lt;cfset test.foo = 2&gt;
&lt;cfoutput&gt;
   #request.myscope[1].test.foo#&lt;br&gt;
&lt;/cfoutput&gt;
&lt;cfset test = StructGet( &quot;request.myscope[1].test[2]&quot; )&gt;
&lt;cfset test.foo = 3&gt;
&lt;cfoutput&gt;
   #request.myscope[1].test[2].foo#&lt;br&gt;
&lt;/cfoutput&gt;
</pre>
         </td>
      </tr>
   </table>
   </div>
<div id="PATHDESIRED">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">PATHDESIRED</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>Pathname of variable that contains structure or array from which ColdFusion retrieves structure.</p>

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

  </body>
</html>
