<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Tutorial:Moving_from_GML_to_EDL</title><link>https://sourceforge.net/p/hpg-projects/wiki/Tutorial%253AMoving_from_GML_to_EDL/</link><description>Recent changes to Tutorial:Moving_from_GML_to_EDL</description><atom:link href="https://sourceforge.net/p/hpg-projects/wiki/Tutorial:Moving_from_GML_to_EDL/feed" rel="self"/><language>en</language><lastBuildDate>Fri, 20 Jan 2023 12:24:27 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/hpg-projects/wiki/Tutorial:Moving_from_GML_to_EDL/feed" rel="self" type="application/rss+xml"/><item><title>Tutorial:Moving_from_GML_to_EDL modified by Hugh Greene</title><link>https://sourceforge.net/p/hpg-projects/wiki/Tutorial%253AMoving_from_GML_to_EDL/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;&lt;a class="" href="/p/hpg-projects/wiki/EDL/" title="wikilink"&gt;EDL&lt;/a&gt; (ENIGMA's development language) is practically&lt;br/&gt;
completely compatible with &lt;a class="" href="/p/hpg-projects/wiki/GML/" title="wikilink"&gt;GML&lt;/a&gt;. This means you can use&lt;br/&gt;
all your existing GML code in ENIGMA and EDL will handle it exactly the&lt;br/&gt;
same. However there are extra features to the EDL language, mainly&lt;br/&gt;
inherited from &lt;a class="" href="/p/hpg-projects/wiki/C%2B%2B/" title="wikilink"&gt;C++&lt;/a&gt;, which allow you to write your code&lt;br/&gt;
more efficiently and can provide extra functionality not available in&lt;br/&gt;
GML. There are also options you can set in the &lt;a class="" href="#ENIGMA_Settings_Panel" title="wikilink"&gt;#ENIGMA Settings&lt;br/&gt;
Panel&lt;/a&gt; in&lt;br/&gt;
&lt;a class="" href="/p/hpg-projects/wiki/LateralGM/" title="wikilink"&gt;LateralGM&lt;/a&gt;, which, among other things, will make&lt;br/&gt;
certain syntax features behave more like C++ instead of GML.&lt;/p&gt;
&lt;h2 id="c-functionality-added"&gt;C++ Functionality Added&lt;/h2&gt;
&lt;p&gt;A lot of C++ functionality has been added to EDL. By using ENIGMA it&lt;br/&gt;
will give you an ideal platform for learning C++ by simply expanding&lt;br/&gt;
upon your existing gml knowledge. You can start to incorporate these new&lt;br/&gt;
techniques at your own pace and eventually have a much fuller grasp of&lt;br/&gt;
the C++ language.&lt;/p&gt;
&lt;h3 id="type-declarations"&gt;Type Declarations&lt;/h3&gt;
&lt;p&gt;Variable type declarations is one of the main things added to EDL which&lt;br/&gt;
will allow you to massively improve the efficiency of your code. In GML&lt;br/&gt;
only two different types can be used: string variants and real variants.&lt;br/&gt;
For&lt;br/&gt;
example:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="n"&gt;my_text&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"word"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="o"&gt;//&lt;/span&gt;&lt;span class="n"&gt;Assigning&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;declares&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;variable&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;as&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;string&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;variant&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;type&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="n"&gt;my_value&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;       &lt;/span&gt;&lt;span class="o"&gt;//&lt;/span&gt;&lt;span class="n"&gt;Assigning&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;number&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;declares&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;variable&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;as&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;real&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;variant&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;type&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="n"&gt;my_color&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;$&lt;/span&gt;&lt;span class="n"&gt;FFAA00&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="o"&gt;//&lt;/span&gt;&lt;span class="n"&gt;Assigning&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;hexadecimal&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;also&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;declares&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;variable&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;as&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;real&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;variant&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;type&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;However in EDL you can assign variables using all c++ &lt;a class="" href="../data_type" title="wikilink"&gt;data&lt;br/&gt;
types&lt;/a&gt;. For example, the above could be rewritten&lt;br/&gt;
as follows:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="n"&gt;string&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;my_text&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;"word"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;//Implicitly declared as a string type.&lt;/span&gt;
&lt;span class="kt"&gt;short&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;my_value&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;     &lt;/span&gt;&lt;span class="c1"&gt;//Implicitly declared as a short type.&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;my_color&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;$FFAA00&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;//Implicitly declared as an integer type.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;This is much more efficient (both memory and speed), but typed variables&lt;br/&gt;
can't change types (you can say &lt;code&gt;myvar = "a"; myvar = 2;&lt;/code&gt; but you can't&lt;br/&gt;
say &lt;code&gt;string myvar = "a"; myver = 2;&lt;/code&gt;). See the &lt;a class="" href="../data_type" title="wikilink"&gt;data&lt;br/&gt;
types&lt;/a&gt; article for more information.&lt;/p&gt;
&lt;p&gt;The scope of the variable can also still be set like&lt;br/&gt;
so:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;my_integer&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;          &lt;/span&gt;&lt;span class="c1"&gt;//would declare in the scope of the current code (like var does it gml).&lt;/span&gt;
&lt;span class="n"&gt;local&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;my_integer&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="c1"&gt;//would declare the variable local to the current object (like gml naturally does with plain assignments).&lt;/span&gt;
&lt;span class="n"&gt;global&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;my_integer&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;   &lt;/span&gt;&lt;span class="c1"&gt;//would declare the variable global (like global. does in gml).&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3 id="carry-on-list"&gt;Carry On List&lt;/h3&gt;
&lt;p&gt;...&lt;/p&gt;
&lt;h2 id="edl-exclusive-functionality"&gt;EDL Exclusive Functionality&lt;/h2&gt;
&lt;p&gt;There are also some features which have been added to EDL which do not&lt;br/&gt;
exist in GML or C++.&lt;/p&gt;
&lt;h3 id="list"&gt;List&lt;/h3&gt;
&lt;h2 id="enigma-settings-panel"&gt;ENIGMA Settings Panel&lt;/h2&gt;
&lt;p&gt;This panel is located either by double clicking the &lt;strong&gt;ENIGMA Settings&lt;/strong&gt;&lt;br/&gt;
tree node, or by going through the menus, ENIGMA &amp;gt; Settings. In here,&lt;br/&gt;
you can change a number of ways that the parser treats code and other&lt;br/&gt;
things. Note that these settings are dynamically loaded in from an&lt;br/&gt;
&lt;a class="" href="../eYAML" title="wikilink"&gt;eYAML&lt;/a&gt; file, and not hard-coded, meaning that they&lt;br/&gt;
are subject to quick change. Unfortunately, it also means that they&lt;br/&gt;
cannot be translated at this time, aside from changing the strings&lt;br/&gt;
yourself.&lt;/p&gt;
&lt;p&gt;Note that many of these settings will break GML compatability if used&lt;br/&gt;
in-code. For example, if you use \n for newlines in ENIGMA, don't be&lt;br/&gt;
surprised when you try to port your game back to Game Maker and see&lt;br/&gt;
literal backslashes followed by n's appearing in your drawn text in&lt;br/&gt;
place of newlines.&lt;/p&gt;
&lt;p&gt;Most of these settings are self-explanatory, but for a refresher, here's&lt;br/&gt;
what they do:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Inherit strings from GML ('A'="A") or from C++ ('A'=65)&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In C++, individual characters ('A') are a native type that resolves&lt;br/&gt;
directly to a number (their ordinal value), whereas strings ("A")&lt;br/&gt;
conclude with an invisible null terminator (\0). In this way, they are&lt;br/&gt;
treated differently. The benefit of this is that, if you actually want&lt;br/&gt;
the ordinal value of of character, you may simply name the character,&lt;br/&gt;
and don't need to pass it through the &lt;a class="" href="../ord" title="wikilink"&gt;ord&lt;/a&gt;() function.&lt;br/&gt;
On the downside, 'A' != "A", because char and string don't compare&lt;br/&gt;
right.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Inherit escape sequences from GML (#) or from C++ (\n)&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This is primarily a visual effect when drawing text to screen. For more&lt;br/&gt;
information, see &lt;a class="" href="../Drawing_text" title="wikilink"&gt;Drawing text&lt;/a&gt;. In GML, to&lt;br/&gt;
create a newline, you simply insert a number sign (#) into your string.&lt;br/&gt;
To draw a literal number sign, double it (##), thus # acts as a kind&lt;br/&gt;
of escape character. In most C-derived languages (C++, Php, Java), we're&lt;br/&gt;
more accustomed to the backslash (\) being the escape character, where&lt;br/&gt;
a newline is \n and a literal backslash being doubled (\\). Note that&lt;br/&gt;
the C++ option will give you more escape sequences (e.g. \t for a tab&lt;br/&gt;
and \0 for a null character - useful things for file/stream writing),&lt;br/&gt;
but also remember that the option is entirely not available in Game&lt;br/&gt;
Maker, meaning that using escape sequences like such will make your game&lt;br/&gt;
incompatible with Game Maker.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Inherit ++/-- from GML (+) or from C++ (+=1/-=1)&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In GML, stringing operators is not overloaded, meaning that they act on&lt;br/&gt;
each other, rather than the parser. For instance, take the following&lt;br/&gt;
piece of code:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;a = 10;
b = --a;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Here, we have a variable &lt;em&gt;&lt;code&gt;a&lt;/code&gt;&lt;/em&gt; storing the value 10. Then, we apply a&lt;br/&gt;
prefix -- to it. In GML, this gets interpreted as &amp;lt;set b="" equal="" to=""&amp;gt;&lt;br/&gt;
\&amp;lt;whatever is before the -- (0)&amp;gt; &amp;lt;minus&amp;gt; &amp;lt;negative&amp;gt; \&amp;lt;value of a&lt;br/&gt;
(10)&amp;gt;. The result is that &lt;code&gt;a = 10; b = 10;&lt;/code&gt;. Recall that a double&lt;br/&gt;
negative becomes a positive. In C++, double operators like -- and ++ are&lt;br/&gt;
overloaded, meaning that they are treated specially, and actually&lt;br/&gt;
increment (++) or decrement (--) the value of the variable that they are&lt;br/&gt;
applied to. Also, prefix (--a) vs postfix (a--) determines if we&lt;br/&gt;
consider the resulting value or the previous value, respectively, for&lt;br/&gt;
the rest of the equation/line of code. In the above code, we have prefix&lt;br/&gt;
--, which means we decrement &lt;em&gt;&lt;code&gt;a&lt;/code&gt;&lt;/em&gt; by 1, and then apply the result to&lt;br/&gt;
the &lt;code&gt;b =&lt;/code&gt;&amp;lt;whatever&amp;gt;. The results are &lt;code&gt;a = 9; b = 9;&lt;/code&gt;. Note that if we&lt;br/&gt;
had done postfix instead, the results would have been &lt;code&gt;a = 9; b = 10;&lt;/code&gt;.&amp;lt;/whatever&amp;gt;&amp;lt;/negative&amp;gt;&amp;lt;/minus&amp;gt;&amp;lt;/set&amp;gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Inherit a=b=c from GML (a=b==c) or from C++ (b=c,a=c)&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This setting deals with the way the equals sign (=) operator is treated.&lt;br/&gt;
GML does a fancy interpretation based on the lexical context. In an&lt;br/&gt;
expression (such as if it were appear on a line of code by itself), it&lt;br/&gt;
sets the left operand to be equal to the right operand, the same as&lt;br/&gt;
C-derived languages (thus, it is an assignment operator). In a&lt;br/&gt;
conditional or evaluation, (like in an if (&amp;lt;here&amp;gt;) statement or as part&lt;br/&gt;
of an operand as in the example a=b=c), it is treated as a boolean&lt;br/&gt;
comparison (returns whether both operands are equivalent, without&lt;br/&gt;
modifying them), similar to the C-derived double equals (==) operator.&lt;br/&gt;
In most other languages, we have separate symbols to indicate whether we&lt;br/&gt;
wish to perform an assignment (= in C, := in Pascal) or a comparison (==&lt;br/&gt;
in C, = in Pascal), meaning that, in C, if you say if (a = b), you&lt;br/&gt;
actually mean "set a equal to b, and test if the resulting value&lt;br/&gt;
evaluates to true (non-zero)", which can easily confuse a newbie. For&lt;br/&gt;
example, take the following piece of code:&amp;lt;/here&amp;gt;&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nv"&gt;a&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;false&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="nv"&gt;b&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;true&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;a&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;b&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;{&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="cm"&gt;/* do something */&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;}&lt;span class="w"&gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;In GML, a comparison will be made and will resolve to false (false !=&lt;br/&gt;
true), and the 'do something' branch will not be executed. In C, the&lt;br/&gt;
user might be quite surprised to find that after the conditional, two&lt;br/&gt;
things happen: a is now suddenly true, and the 'do something' branch&lt;br/&gt;
executes. As such, it's usually encouraged for newer users who don't&lt;br/&gt;
know their = from their == to use the GML setting, while more&lt;br/&gt;
experienced users who know or have use for the difference (e.g. reading&lt;br/&gt;
input from a file, if (a = fread()) - which stops executing the branch&lt;br/&gt;
when the fread returns null, indicating that the stream is empty) would&lt;br/&gt;
use the C++ setting.&lt;/p&gt;
&lt;p&gt;Note that this says nothing of the special Pascal := and C-derived ==&lt;br/&gt;
operators, which are exclusively for setting and comparing,&lt;br/&gt;
respectively.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Treat &lt;a class="" href="../literal" title="wikilink"&gt;literals&lt;/a&gt; as EDL (variant) or C++&lt;br/&gt;
    (scalar)&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This is one of the finer points of C++ and an understanding of pointers&lt;br/&gt;
and strings. EDL alleviates much of the stress of dealing with strings&lt;br/&gt;
by abstracting away the pointers and the C artifacts that C++ exhibits.&lt;br/&gt;
This especially stands out when we consider two cases: &lt;code&gt;"wo" + "man";&lt;/code&gt;&lt;br/&gt;
and &lt;code&gt;"woman" + 2;&lt;/code&gt;. In the first case, normally we'd expect a result of&lt;br/&gt;
"woman", but in the C++ world, it's adding two pointers together, which&lt;br/&gt;
doesn't make sense, and thus errors. In the second case, we might expect&lt;br/&gt;
"woman2", but in the C++ world, we'd expect the pointer to move over 2&lt;br/&gt;
characters, resulting in "man".&lt;/p&gt;
&lt;p&gt;In brief, this determines whether a literal, such as "string", and 0.5,&lt;br/&gt;
are stored in a &lt;a class="" href="../variant" title="wikilink"&gt;variant&lt;/a&gt;, or in their C++ native&lt;br/&gt;
scalar types. Another effect of this is that we can use variants in&lt;br/&gt;
conditionals, so things like &lt;code&gt;if (0.5)&lt;/code&gt; will work.&lt;/p&gt;
&lt;h2 id="inconsistencies"&gt;Inconsistencies&lt;/h2&gt;
&lt;p&gt;There are still a few small inconsistencies between GML and EDL, these&lt;br/&gt;
are listed on the &lt;a class="" href="../discarded_behaviors" title="wikilink"&gt;discarded behaviors&lt;/a&gt;&lt;br/&gt;
page. Since ENIGMA is still in development there is also obviously still&lt;br/&gt;
a lot of functionality that needs to be completed for full&lt;br/&gt;
compatibility, you can find these things listed on the&lt;br/&gt;
&lt;a class="" title="wikilink"&gt;ENIGMA:Todo&lt;/a&gt; page.&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:24:27 -0000</pubDate><guid>https://sourceforge.net480bc323ea5db15750d2c8c5f400264965b74b93</guid></item></channel></rss>