<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.digitalmzx.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Counter</id>
	<title>Counter - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.digitalmzx.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Counter"/>
	<link rel="alternate" type="text/html" href="https://www.digitalmzx.com/wiki/index.php?title=Counter&amp;action=history"/>
	<updated>2026-05-09T00:11:18Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.7</generator>
	<entry>
		<id>https://www.digitalmzx.com/wiki/index.php?title=Counter&amp;diff=6694&amp;oldid=prev</id>
		<title>Terryn: oops!</title>
		<link rel="alternate" type="text/html" href="https://www.digitalmzx.com/wiki/index.php?title=Counter&amp;diff=6694&amp;oldid=prev"/>
		<updated>2009-02-09T17:38:29Z</updated>

		<summary type="html">&lt;p&gt;oops!&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 17:38, 9 February 2009&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l3&quot;&gt;Line 3:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 3:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;While most counters in a MZX game are user defined, MZX also provides a couple hundred built-in counters and counter-like constructs to access special functions and information. These are detailed by category in the [http://www.digitalmzx.net/mzxhelp.php/COUNTERS.HLP#1st help file], which is a very good resource for any MZX programmer.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;While most counters in a MZX game are user defined, MZX also provides a couple hundred built-in counters and counter-like constructs to access special functions and information. These are detailed by category in the [http://www.digitalmzx.net/mzxhelp.php/COUNTERS.HLP#1st help file], which is a very good resource for any MZX programmer.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Another important type of counter is the local counter.  Most counters are global, meaning they can be accessed from anywhere in the game and by any robot.  By contrast, local counters are specifically tied to an individual robot, so that the same name referenced or set by one robot will access a different value than another robot would.  Robots on the same board can read or write to each others' local counters, as long as it is specified which Robot's counters are being accessed (this is done by prefixing the counter name with &amp;quot;r&amp;amp;lt;[[robot_id]]&amp;amp;gt;.&amp;quot; e.g. reading the first Robot's &amp;quot;local&amp;quot; counter is done by reading &amp;quot;r1.local&amp;quot;).  The most important local counters are named &amp;quot;local#&amp;quot;, where # is a number from a range of 32 numbers (usually local1-local32 or local0-local31); &amp;quot;local1&amp;quot; can be represented by just &amp;quot;local&amp;quot;. All of these are technically built-in since their names are fixed, but most have no special function except to be local counters. (Other local counters exist - [[loopcount]], bullettype, and lava_walk - but they are tied to actual Robot functions and can have other imposing limits, such as a range of only 0-&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;256&lt;/del&gt;.)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Another important type of counter is the local counter.  Most counters are global, meaning they can be accessed from anywhere in the game and by any robot.  By contrast, local counters are specifically tied to an individual robot, so that the same name referenced or set by one robot will access a different value than another robot would.  Robots on the same board can read or write to each others' local counters, as long as it is specified which Robot's counters are being accessed (this is done by prefixing the counter name with &amp;quot;r&amp;amp;lt;[[robot_id]]&amp;amp;gt;.&amp;quot; e.g. reading the first Robot's &amp;quot;local&amp;quot; counter is done by reading &amp;quot;r1.local&amp;quot;).  The most important local counters are named &amp;quot;local#&amp;quot;, where # is a number from a range of 32 numbers (usually local1-local32 or local0-local31); &amp;quot;local1&amp;quot; can be represented by just &amp;quot;local&amp;quot;. All of these are technically built-in since their names are fixed, but most have no special function except to be local counters. (Other local counters exist - [[loopcount]], bullettype, and lava_walk - but they are tied to actual Robot functions and can have other imposing limits, such as a range of only 0-&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;255&lt;/ins&gt;.)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;When MegaZeux executes a [[swap world]], all non-local counters are retained; all local counters are reset.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;When MegaZeux executes a [[swap world]], all non-local counters are retained; all local counters are reset.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Terryn</name></author>
	</entry>
	<entry>
		<id>https://www.digitalmzx.com/wiki/index.php?title=Counter&amp;diff=6691&amp;oldid=prev</id>
		<title>Terryn: Adding info about status counters. That should be enough info for this page.</title>
		<link rel="alternate" type="text/html" href="https://www.digitalmzx.com/wiki/index.php?title=Counter&amp;diff=6691&amp;oldid=prev"/>
		<updated>2009-02-09T16:49:34Z</updated>

		<summary type="html">&lt;p&gt;Adding info about status counters. That should be enough info for this page.&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 16:49, 9 February 2009&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l6&quot;&gt;Line 6:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 6:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;When MegaZeux executes a [[swap world]], all non-local counters are retained; all local counters are reset.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;When MegaZeux executes a [[swap world]], all non-local counters are retained; all local counters are reset.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;In older versions of MegaZeux, it was a fairly common practice to designate certain counters as ''status counters''; making a counter a status counter meant that the counter name and value would be shown in the default status menu if the value was not 0. Up to six counters at once can be status counters. With the added ability to remove and replace the default status menu, this fell out of use.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:MegaZeux]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:MegaZeux]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Terryn</name></author>
	</entry>
	<entry>
		<id>https://www.digitalmzx.com/wiki/index.php?title=Counter&amp;diff=6690&amp;oldid=prev</id>
		<title>Terryn: You can write to others' locals; swap world actions; more elaboration on locals (koji actually uses 0-31 for some inane reason).</title>
		<link rel="alternate" type="text/html" href="https://www.digitalmzx.com/wiki/index.php?title=Counter&amp;diff=6690&amp;oldid=prev"/>
		<updated>2009-02-09T16:40:30Z</updated>

		<summary type="html">&lt;p&gt;You can write to others&amp;#039; locals; swap world actions; more elaboration on locals (koji actually uses 0-31 for some inane reason).&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 16:40, 9 February 2009&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;A '''counter''' is essentially [[Megazeux]] vernacular for a variable, meaning a piece of data in the program whose value can change.  Specifically in the case of MZX, counters are integer numbers, not [[strings]], and not floating-point numbers.  In standard programming terms, most counters are signed, 32-bit integers, meaning any number between -2,147,483,648 and 2,147,483,647.  In the past, before the [[MegaZeux#SDL Port|MZX port]], counters were 16-bit, or between -32768 and 32767.  However, some counters with built-in meanings and uses assume different ranges, or don't have actual ranges at all because they indicate special syntax instead of numeric values.  For example, the counter &amp;quot;[[file access|fwrite_open]]&amp;quot; doesn't correspond to any value itself, and instead provides an access point for opening a file.  MZX has also changed over the years in terms of the number of counters it has allowed the user to define.  As late as version 2.51, only 50 could be active (i.e. non-zero) at one time.  Over time, this number was expanded, and then in the port the limit was effectively removed.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;A '''counter''' is essentially [[Megazeux]] vernacular for a variable, meaning a piece of data in the program whose value can change.  Specifically in the case of MZX, counters are integer numbers, not [[strings]], and not floating-point numbers.  In standard programming terms, most counters are signed, 32-bit integers, meaning any number between -2,147,483,648 and 2,147,483,647.  In the past, before the [[MegaZeux#SDL Port|MZX port]], counters were 16-bit, or between -32768 and 32767.  However, some counters with built-in meanings and uses assume different ranges, or don't have actual ranges at all because they indicate special syntax instead of numeric values.  For example, the counter &amp;quot;[[file access|fwrite_open]]&amp;quot; doesn't correspond to any value itself, and instead provides an access point for opening a file.  MZX has also changed over the years in terms of the number of counters it has allowed the user to define.  As late as version 2.51, only 50 could be active (i.e. non-zero) at one time.  Over time, this number was expanded, and then in the port the limit was effectively removed.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;While most counters in a MZX game are user defined, MZX also provides a couple hundred built-in counters and counter-like constructs to access special functions and information. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; &lt;/del&gt;These are detailed by category in the [http://www.digitalmzx.net/mzxhelp.php/COUNTERS.HLP#1st help file], which is a very good resource for any MZX programmer.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;While most counters in a MZX game are user defined, MZX also provides a couple hundred built-in counters and counter-like constructs to access special functions and information. These are detailed by category in the [http://www.digitalmzx.net/mzxhelp.php/COUNTERS.HLP#1st help file], which is a very good resource for any MZX programmer.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Another important type of counter is the local counter.  Most counters are global, meaning they can be accessed from anywhere in the game and by any robot.  By contrast, local counters are specifically tied to an individual robot, so that the same name referenced or set by one robot will access a different value than another robot would.  Robots on the same board can read each others' local counters, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;but can&lt;/del&gt;'&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;t write values to them&lt;/del&gt;.  The most important local counters are named &amp;quot;local#&amp;quot;, where # is &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;an optional &lt;/del&gt;number &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;between 1 and &lt;/del&gt;32. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; &lt;/del&gt;All of these are technically built-in since their names are fixed, but most have no special function except to be local counters.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Another important type of counter is the local counter.  Most counters are global, meaning they can be accessed from anywhere in the game and by any robot.  By contrast, local counters are specifically tied to an individual robot, so that the same name referenced or set by one robot will access a different value than another robot would.  Robots on the same board can read &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;or write to &lt;/ins&gt;each others' local counters, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;as long as it is specified which Robot's counters are being accessed (this is done by prefixing the counter name with &amp;quot;r&amp;amp;lt;[[robot_id]]&amp;amp;gt;.&amp;quot; e.g. reading the first Robot&lt;/ins&gt;'&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;s &amp;quot;local&amp;quot; counter is done by reading &amp;quot;r1.local&amp;quot;)&lt;/ins&gt;.  The most important local counters are named &amp;quot;local#&amp;quot;, where # is &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;a &lt;/ins&gt;number &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;from a range of &lt;/ins&gt;32 &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;numbers (usually local1-local32 or local0-local31); &amp;quot;local1&amp;quot; can be represented by just &amp;quot;local&amp;quot;&lt;/ins&gt;. All of these are technically built-in since their names are fixed, but most have no special function except to be local counters. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;(Other local counters exist - [[loopcount]], bullettype, and lava_walk - but they are tied to actual Robot functions and can have other imposing limits, such as a range of only 0-256.)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{stub}}&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;When MegaZeux executes a [[swap world]], all non-local counters are retained; all local counters are reset.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:MegaZeux]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:MegaZeux]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Terryn</name></author>
	</entry>
	<entry>
		<id>https://www.digitalmzx.com/wiki/index.php?title=Counter&amp;diff=6638&amp;oldid=prev</id>
		<title>Terryn: Fixed. The extremities don't have the same absolute value because 0 takes up a space.</title>
		<link rel="alternate" type="text/html" href="https://www.digitalmzx.com/wiki/index.php?title=Counter&amp;diff=6638&amp;oldid=prev"/>
		<updated>2009-01-29T20:32:48Z</updated>

		<summary type="html">&lt;p&gt;Fixed. The extremities don&amp;#039;t have the same absolute value because 0 takes up a space.&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 20:32, 29 January 2009&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;A '''counter''' is essentially [[Megazeux]] vernacular for a variable, meaning a piece of data in the program whose value can change.  Specifically in the case of MZX, counters are integer numbers, not [[strings]], and not floating-point numbers.  In standard programming terms, most counters are signed, 32-bit integers, meaning any number between -2,147,483,648 and 2,147,483,&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;648&lt;/del&gt;.  In the past, before the [[MegaZeux#SDL Port|MZX port]], counters were 16-bit, or between -32768 and 32767.  However, some counters with built-in meanings and uses assume different ranges, or don't have actual ranges at all because they indicate special syntax instead of numeric values.  For example, the counter &amp;quot;[[file access|fwrite_open]]&amp;quot; doesn't correspond to any value itself, and instead provides an access point for opening a file.  MZX has also changed over the years in terms of the number of counters it has allowed the user to define.  As late as version 2.51, only 50 could be active (i.e. non-zero) at one time.  Over time, this number was expanded, and then in the port the limit was effectively removed.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;A '''counter''' is essentially [[Megazeux]] vernacular for a variable, meaning a piece of data in the program whose value can change.  Specifically in the case of MZX, counters are integer numbers, not [[strings]], and not floating-point numbers.  In standard programming terms, most counters are signed, 32-bit integers, meaning any number between -2,147,483,648 and 2,147,483,&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;647&lt;/ins&gt;.  In the past, before the [[MegaZeux#SDL Port|MZX port]], counters were 16-bit, or between -32768 and 32767.  However, some counters with built-in meanings and uses assume different ranges, or don't have actual ranges at all because they indicate special syntax instead of numeric values.  For example, the counter &amp;quot;[[file access|fwrite_open]]&amp;quot; doesn't correspond to any value itself, and instead provides an access point for opening a file.  MZX has also changed over the years in terms of the number of counters it has allowed the user to define.  As late as version 2.51, only 50 could be active (i.e. non-zero) at one time.  Over time, this number was expanded, and then in the port the limit was effectively removed.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;While most counters in a MZX game are user defined, MZX also provides a couple hundred built-in counters and counter-like constructs to access special functions and information.  These are detailed by category in the [http://www.digitalmzx.net/mzxhelp.php/COUNTERS.HLP#1st help file], which is a very good resource for any MZX programmer.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;While most counters in a MZX game are user defined, MZX also provides a couple hundred built-in counters and counter-like constructs to access special functions and information.  These are detailed by category in the [http://www.digitalmzx.net/mzxhelp.php/COUNTERS.HLP#1st help file], which is a very good resource for any MZX programmer.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Terryn</name></author>
	</entry>
	<entry>
		<id>https://www.digitalmzx.com/wiki/index.php?title=Counter&amp;diff=6365&amp;oldid=prev</id>
		<title>Wervyn: New page: A '''counter''' is essentially Megazeux vernacular for a variable, meaning a piece of data in the program whose value can change.  Specifically in the case of MZX, counters are integer...</title>
		<link rel="alternate" type="text/html" href="https://www.digitalmzx.com/wiki/index.php?title=Counter&amp;diff=6365&amp;oldid=prev"/>
		<updated>2008-10-23T19:51:23Z</updated>

		<summary type="html">&lt;p&gt;New page: A &amp;#039;&amp;#039;&amp;#039;counter&amp;#039;&amp;#039;&amp;#039; is essentially &lt;a href=&quot;/wiki/Megazeux&quot; class=&quot;mw-redirect&quot; title=&quot;Megazeux&quot;&gt;Megazeux&lt;/a&gt; vernacular for a variable, meaning a piece of data in the program whose value can change.  Specifically in the case of MZX, counters are integer...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;A '''counter''' is essentially [[Megazeux]] vernacular for a variable, meaning a piece of data in the program whose value can change.  Specifically in the case of MZX, counters are integer numbers, not [[strings]], and not floating-point numbers.  In standard programming terms, most counters are signed, 32-bit integers, meaning any number between -2,147,483,648 and 2,147,483,648.  In the past, before the [[MegaZeux#SDL Port|MZX port]], counters were 16-bit, or between -32768 and 32767.  However, some counters with built-in meanings and uses assume different ranges, or don't have actual ranges at all because they indicate special syntax instead of numeric values.  For example, the counter &amp;quot;[[file access|fwrite_open]]&amp;quot; doesn't correspond to any value itself, and instead provides an access point for opening a file.  MZX has also changed over the years in terms of the number of counters it has allowed the user to define.  As late as version 2.51, only 50 could be active (i.e. non-zero) at one time.  Over time, this number was expanded, and then in the port the limit was effectively removed.&lt;br /&gt;
&lt;br /&gt;
While most counters in a MZX game are user defined, MZX also provides a couple hundred built-in counters and counter-like constructs to access special functions and information.  These are detailed by category in the [http://www.digitalmzx.net/mzxhelp.php/COUNTERS.HLP#1st help file], which is a very good resource for any MZX programmer.&lt;br /&gt;
&lt;br /&gt;
Another important type of counter is the local counter.  Most counters are global, meaning they can be accessed from anywhere in the game and by any robot.  By contrast, local counters are specifically tied to an individual robot, so that the same name referenced or set by one robot will access a different value than another robot would.  Robots on the same board can read each others' local counters, but can't write values to them.  The most important local counters are named &amp;quot;local#&amp;quot;, where # is an optional number between 1 and 32.  All of these are technically built-in since their names are fixed, but most have no special function except to be local counters.&lt;br /&gt;
&lt;br /&gt;
{{stub}}&lt;br /&gt;
&lt;br /&gt;
[[Category:MegaZeux]]&lt;/div&gt;</summary>
		<author><name>Wervyn</name></author>
	</entry>
</feed>