<head><title>ColdC: Function/Method Reference: data()</title></head> <body> <h1 align=center><a href="/ColdC/">ColdC</a>: <a href="/ColdC/Functions/">Function/Method Reference</a>: data()</h1> <hr> <p> <font size=+1><i>ANY</i> <b>data</b>([<i>OBJNUM <b>ancestor</b></i>])</font> <p>This function is used to retrieve the values for object variables on the current object. If <var>ancestor</var> is not defined it will return all data defined by any ancestor. If <var>ancestor</var> is defined it will only return data which is defined by the specific ancestor. <p>A dictionary is generated for each ancestor which defines data (or for the specific requested ancestor). Each variable defined by the ancestor is a key in the dictionary, with he association to the key being the value of the object variable. For instance, if object $root defined the variable <var>name</var> with a value of <code>"Fred"</code>, the association in the dictionary would be <code>['name, "Fred"]</code>. Reference the section on <a href="/ColdC/Structure/types.html#dict">Dictionaries</a> for more details on the construction of dictionaries. <p>If only one ancestor is requested with <code>data()</code> then only the dictionary for that ancestor is returned. If no ancestor is specified then another dictionary is created, with each ancestor being a key and the association being the dictionary containing the object variables for that ancestor. <P>If an ancestor defines an object variable, but has never assigned a value to it on the current object (or the object variable has been cleared using the function <a href="clear_var.html"><code>clear_var()</code></a>), it is not included in the dictionary. <p>The keys in a dictionary returned by <CODE>data()</CODE> do not have any particular ordering. <p><hr size=4><p align=center><i>Last Modified on Feb 28 1996</i> <br><i>Copyright © 1995, 1996, Brandon Gillespie</i> </body>