<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Dot_access</title><link>https://sourceforge.net/p/hpg-projects/wiki/Dot_access/</link><description>Recent changes to Dot_access</description><atom:link href="https://sourceforge.net/p/hpg-projects/wiki/Dot_access/feed" rel="self"/><language>en</language><lastBuildDate>Fri, 20 Jan 2023 12:14:17 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/hpg-projects/wiki/Dot_access/feed" rel="self" type="application/rss+xml"/><item><title>Dot_access modified by Hugh Greene</title><link>https://sourceforge.net/p/hpg-projects/wiki/Dot_access/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;In EDL, &lt;a class="" href="../dot_access" title="wikilink"&gt;dot access&lt;/a&gt; refers to expressions of the&lt;br/&gt;
form &lt;code&gt;a.b&lt;/code&gt;, and can be used in a number of ways.&lt;/p&gt;
&lt;h2 id="variables"&gt;Variables&lt;/h2&gt;
&lt;p&gt;Typically when dot-based access is brought up, it is referring to the&lt;br/&gt;
method inherited from GML, in which &lt;em&gt;&lt;code&gt;a&lt;/code&gt;&lt;/em&gt; is an integer referencing an&lt;br/&gt;
&lt;a class="" href="../instance" title="wikilink"&gt;instance&lt;/a&gt; ID or &lt;a class="" href="../object" title="wikilink"&gt;object&lt;/a&gt; index,&lt;br/&gt;
and &lt;em&gt;&lt;code&gt;b&lt;/code&gt;&lt;/em&gt; is a &lt;a class="" href="../local" title="wikilink"&gt;local&lt;/a&gt;&lt;br/&gt;
&lt;a class="" href="../variable" title="wikilink"&gt;variable&lt;/a&gt;. This expression will look up an object&lt;br/&gt;
with either an ID or Object index of &lt;em&gt;&lt;code&gt;a&lt;/code&gt;&lt;/em&gt;, then access &lt;em&gt;&lt;code&gt;b&lt;/code&gt;&lt;/em&gt; from&lt;br/&gt;
within its &lt;a class="" href="../scope" title="wikilink"&gt;scope&lt;/a&gt;. This is useful for objects and&lt;br/&gt;
instances accessing a local variable of another object or instance,&lt;br/&gt;
either to read or change it.&lt;/p&gt;
&lt;h2 id="fields"&gt;Fields&lt;/h2&gt;
&lt;p&gt;EDL also inherits the dot operator from C++. It can therefore also be&lt;br/&gt;
used to access explicit fields in &lt;a class="" href="../structures" title="wikilink"&gt;structures&lt;/a&gt;&lt;br/&gt;
and &lt;a class="" href="../classes" title="wikilink"&gt;classes&lt;/a&gt;, whether the base &lt;em&gt;&lt;code&gt;a&lt;/code&gt;&lt;/em&gt; is itself an&lt;br/&gt;
instance of that structure, or a pointer to such an instance.&lt;/p&gt;
&lt;h2 id="functions"&gt;Functions&lt;/h2&gt;
&lt;p&gt;Finally, &lt;a class="" href="../functions" title="wikilink"&gt;functions&lt;/a&gt; can also be accessed in this&lt;br/&gt;
way, which is not a feature of GML or C++ (except as class members). The&lt;br/&gt;
most obvious example of this is class members, such as &lt;code&gt;a.func()&lt;/code&gt; where&lt;br/&gt;
&lt;em&gt;&lt;code&gt;a&lt;/code&gt;&lt;/em&gt; is again an instance of a structure/class, and &lt;em&gt;&lt;code&gt;func&lt;/code&gt;&lt;/em&gt; is a&lt;br/&gt;
member function of that class. Of course, this is only useful if said&lt;br/&gt;
structure/class already defined such a function.&lt;/p&gt;
&lt;p&gt;The more interesting implication is instance-scoped functions, for&lt;br/&gt;
example, &lt;code&gt;a.instance_destroy()&lt;/code&gt; would function exactly the same as &lt;code&gt;with
(a) instance_destroy()&lt;/code&gt;. Note that instance-scoped functions are not&lt;br/&gt;
implemented at this time, but are planned for the near future. In the&lt;br/&gt;
meantime, simply use &lt;code&gt;with&lt;/code&gt; as a workaround. Member functions and field&lt;br/&gt;
access, however, are implemented.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Hugh Greene</dc:creator><pubDate>Fri, 20 Jan 2023 12:14:17 -0000</pubDate><guid>https://sourceforge.netaf47191c8c891e89539d5bfdad12690ff71550de</guid></item></channel></rss>