<?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=Set.loop</id>
	<title>Set.loop - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.sierrahelp.com/index.php?action=history&amp;feed=atom&amp;title=Set.loop"/>
	<link rel="alternate" type="text/html" href="http://wiki.sierrahelp.com/index.php?title=Set.loop&amp;action=history"/>
	<updated>2026-11-18T23:27:57Z</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=Set.loop&amp;diff=71928&amp;oldid=prev</id>
		<title>Andrew Branscom: 2 revisions imported</title>
		<link rel="alternate" type="text/html" href="http://wiki.sierrahelp.com/index.php?title=Set.loop&amp;diff=71928&amp;oldid=prev"/>
		<updated>2025-02-16T21:05:27Z</updated>

		<summary type="html">&lt;p&gt;2 revisions 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 16:05, 16 February 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=Set.loop&amp;diff=71927&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=Set.loop&amp;diff=71927&amp;oldid=prev"/>
		<updated>2024-06-03T05:14:29Z</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 00:14, 3 June 2024&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=Set.loop&amp;diff=71926&amp;oldid=prev</id>
		<title>Andrew Branscom: 3 revisions imported</title>
		<link rel="alternate" type="text/html" href="http://wiki.sierrahelp.com/index.php?title=Set.loop&amp;diff=71926&amp;oldid=prev"/>
		<updated>2022-01-28T16:19:49Z</updated>

		<summary type="html">&lt;p&gt;3 revisions imported&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;set.loop&amp;#039;&amp;#039;&amp;#039; command assigns a loop to a screen object.&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&lt;br /&gt;
set.loop([[screen object|obj]] oA, [[number|byt]] LOOP);&lt;br /&gt;
&lt;br /&gt;
== Remarks ==&lt;br /&gt;
&lt;br /&gt;
The current [[loop]] of [[screen object]] &amp;#039;&amp;#039;&amp;#039;oA&amp;#039;&amp;#039;&amp;#039; is set to &amp;#039;&amp;#039;&amp;#039;LOOP&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
A [[View Resource (AGI)|view]] must be be assigned to the object first. If a view is not assigned, AGI raises [[trappable error #6]]. If &amp;#039;&amp;#039;&amp;#039;LOOP&amp;#039;&amp;#039;&amp;#039; is not a valid loop number, i.e. it exceeds the maximum number of available loops in the view, AGI raises [[trappable error #5]].&lt;br /&gt;
&lt;br /&gt;
Be aware that there is a bug in all versions of AGI affecting the check for valid loop numbers. AGI only returns [[trappable error #5]] if the value of &amp;#039;&amp;#039;&amp;#039;LOOP&amp;#039;&amp;#039;&amp;#039; is GREATER than the total number of loops in the view. However, since loops are zero based (first loop is 0, second loop is one, etc.), the last valid loop would be total loop count minus one. If &amp;#039;&amp;#039;&amp;#039;LOOP&amp;#039;&amp;#039;&amp;#039; is EQUAL to the loop count, AGI doesn&amp;#039;t raise an error, but the loop number is actually invalid, and using it will almost always end up in [[crashing AGI]].&lt;br /&gt;
&lt;br /&gt;
When the loop changes, AGI checks to see if the current [[cel]] value of the screen object is now greater than the last cel in newly assigned loop. If it is, the cel is reset to 0; if not the screen object&amp;#039;s cel value is not changed. &lt;br /&gt;
&lt;br /&gt;
== Possible Errors ==&lt;br /&gt;
&lt;br /&gt;
In [[version]] 2.089 only, AGI raises [[trappable error #4]] if object number &amp;#039;&amp;#039;&amp;#039;oA&amp;#039;&amp;#039;&amp;#039; is invalid. In all later versions, AGI does not check that object number &amp;#039;&amp;#039;&amp;#039;oA&amp;#039;&amp;#039;&amp;#039; is a valid object. If it is not, this command will overwrite other data on the [[memory heap]], which may cause unexpected results, including possibly [[crashing AGI]].&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;
[ typical code to add a static view&lt;br /&gt;
animate.obj(o1);&lt;br /&gt;
load.view(8);&lt;br /&gt;
set.view(o1, 8);&lt;br /&gt;
set.loop(o1, 1);&lt;br /&gt;
set.cel(o1, 2);&lt;br /&gt;
position(o1, 20, 132);&lt;br /&gt;
stop.cycling(o1);&lt;br /&gt;
draw(o1);&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;
| 43 (0x2B hex)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;[[set.cel]]&amp;#039;&amp;#039;&amp;#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;[[set.cel.v]]&amp;#039;&amp;#039;&amp;#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;[[set.loop.v]]&amp;#039;&amp;#039;&amp;#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;[[set.view]]&amp;#039;&amp;#039;&amp;#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;[[set.view.v]]&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>Andrew Branscom</name></author>
	</entry>
</feed>