<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.sierrahelp.com/index.php?action=history&amp;feed=atom&amp;title=Subn</id>
	<title>Subn - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.sierrahelp.com/index.php?action=history&amp;feed=atom&amp;title=Subn"/>
	<link rel="alternate" type="text/html" href="http://wiki.sierrahelp.com/index.php?title=Subn&amp;action=history"/>
	<updated>2026-09-23T20:39:17Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>http://wiki.sierrahelp.com/index.php?title=Subn&amp;diff=89094&amp;oldid=prev</id>
		<title>Andrew Branscom: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="http://wiki.sierrahelp.com/index.php?title=Subn&amp;diff=89094&amp;oldid=prev"/>
		<updated>2025-04-03T21:04:09Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 17:04, 3 April 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Andrew Branscom</name></author>
	</entry>
	<entry>
		<id>http://wiki.sierrahelp.com/index.php?title=Subn&amp;diff=89093&amp;oldid=prev</id>
		<title>en&gt;Andrew Korson: Created page with &quot;The &#039;&#039;&#039;subn&#039;&#039;&#039; command subtracts a numerical value from a variable.  == Syntax ==  subn(var vA, byt B);&lt;br /&gt; vA = vA - B;&lt;br /&gt; vA -= B;&lt;br /&gt;  == Rem...&quot;</title>
		<link rel="alternate" type="text/html" href="http://wiki.sierrahelp.com/index.php?title=Subn&amp;diff=89093&amp;oldid=prev"/>
		<updated>2019-04-24T02:44:48Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;The &amp;#039;&amp;#039;&amp;#039;subn&amp;#039;&amp;#039;&amp;#039; command subtracts a numerical value from a variable.  == Syntax ==  subn(&lt;a href=&quot;/index.php/Variable&quot; title=&quot;Variable&quot;&gt;var&lt;/a&gt; vA, &lt;a href=&quot;/index.php/Number&quot; title=&quot;Number&quot;&gt;byt&lt;/a&gt; B);&amp;lt;br /&amp;gt; vA = vA - B;&amp;lt;br /&amp;gt; vA -= B;&amp;lt;br /&amp;gt;  == Rem...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;The &amp;#039;&amp;#039;&amp;#039;subn&amp;#039;&amp;#039;&amp;#039; command subtracts a numerical value from a variable.&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&lt;br /&gt;
subn([[variable|var]] vA, [[number|byt]] B);&amp;lt;br /&amp;gt;&lt;br /&gt;
vA = vA - B;&amp;lt;br /&amp;gt;&lt;br /&gt;
vA -= B;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Remarks ==&lt;br /&gt;
&lt;br /&gt;
Because [[variable]]s are 8 bit unsigned numbers, if the result of the subtraction is less than 0, the result &amp;#039;wraps around&amp;#039;. For example, if v50 currently equals&lt;br /&gt;
20, the statement:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;CODE&amp;gt;subn(v50, 25);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will result in a value for v50 of 251 (20 - 25 = -5; -5 + 256 = 251).&lt;br /&gt;
&lt;br /&gt;
If the value of &amp;#039;&amp;#039;&amp;#039;B&amp;#039;&amp;#039;&amp;#039; is 1, WinAGI will use the &amp;#039;&amp;#039;&amp;#039;[[decrement]]&amp;#039;&amp;#039;&amp;#039; command instead of &amp;#039;&amp;#039;&amp;#039;subn&amp;#039;&amp;#039;&amp;#039; if you use the alternate syntax (i.e. &amp;#039;&amp;#039;&amp;#039;vA&amp;#039;&amp;#039;&amp;#039; = &amp;#039;&amp;#039;&amp;#039;vA&amp;#039;&amp;#039;&amp;#039; - 1 or &amp;#039;&amp;#039;&amp;#039;vA&amp;#039;&amp;#039;&amp;#039; -= 1). To force the compiler to use &amp;#039;&amp;#039;&amp;#039;subn&amp;#039;&amp;#039;&amp;#039;, use the full form: subn(&amp;#039;&amp;#039;&amp;#039;vA&amp;#039;&amp;#039;&amp;#039;, 1). This important because the &amp;#039;&amp;#039;&amp;#039;decrement&amp;#039;&amp;#039;&amp;#039; command does not wrap around like the &amp;#039;&amp;#039;&amp;#039;subn&amp;#039;&amp;#039;&amp;#039; command.&lt;br /&gt;
&lt;br /&gt;
== Possible Errors ==&lt;br /&gt;
&lt;br /&gt;
None.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;CodeBlockHeader&amp;quot;&amp;gt;Code:&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;agi&amp;quot;&amp;gt;&lt;br /&gt;
v50 = 40;&lt;br /&gt;
subn(v50, 25);  [ v50 now equals 15&lt;br /&gt;
v50 = v50 - 25; [ v50 now equals 246 (-10 + 256)&lt;br /&gt;
v50 -= 25;      [ v50 now equals 221&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Technical Information ==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
| style=&amp;quot;background-color: #efefef&amp;quot; width=&amp;quot;200&amp;quot; | &amp;#039;&amp;#039;&amp;#039;Required Interpreter Version:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| width=&amp;quot;175&amp;quot; | Available in all AGI versions.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background-color: #efefef&amp;quot; | &amp;#039;&amp;#039;&amp;#039;Byte-Code Value:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| 7 (0x07 hex)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
[[Mathematical Commands]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;[[subv]]&amp;#039;&amp;#039;&amp;#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;[[decrement]]&amp;#039;&amp;#039;&amp;#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
[[Category:Commands]]&amp;lt;br /&amp;gt;&lt;/div&gt;</summary>
		<author><name>en&gt;Andrew Korson</name></author>
	</entry>
</feed>