Difference between revisions of "Current.loop"

From AGI Wiki
Jump to navigationJump to search
(Created page with "current.loop   == <br />Syntax == <blockquote><code>current.loop(oA,vB);</code></blockquote>   == Description == vB is set to the number of the current loop of ...")
 
 
Line 1: Line 1:
current.loop
+
The '''current.loop''' command stores the number of the current loop of an object in a variable.
  
&nbsp;
+
== Syntax ==
  
== <br />Syntax ==
+
current.loop([[screen object|obj]] oA, [[variable|var]] vB);
  
<blockquote><code>current.loop(oA,vB);</code></blockquote>
+
== Remarks ==
  
&nbsp;
+
Variable '''vB''' is set to the current [[loop]] number for [[screen object|object]] '''oA'''.
== Description ==
 
  
vB is set to the number of the current loop of object oA.
+
== Possible Errors ==
  
&nbsp;
+
AGI does not check that object number oA is a valid object. If it is not, the  returned value is meaningless.
== Sources ==
 
  
[[AGI Studio Help File]]
+
== Example ==
  
&nbsp;
+
<div class="CodeBlockHeader">Code:</div>
 +
<syntaxhighlight lang="agi">
 +
current.loop(o0, v51); [ v51 now holds ego's current loop
 +
</syntaxhighlight>
  
== See also ==
+
== Technical Information ==
  
* <code>[[number.of.loops]]</code>
+
{| border="1" cellpadding="2"
* <code>[[set.loop]]</code>
+
| style="background-color: #efefef" width="200" | '''Required Interpreter Version:'''
* <code>[[set.loop.v]]</code>
+
| width="175" | Available in all AGI versions.
* <code>[[current.cel]]</code>
+
|-
 +
| style="background-color: #efefef" | '''Byte-Code Value:'''
 +
| 51 (0x33 hex)
 +
|}
  
&nbsp;
+
== See Also ==
  
[[Category:Object Commands]]
+
'''[[current.cel]]'''<br />
[[Category:View Commands]]
+
'''[[current.view]]'''<br />
 +
'''[[last.cel]]'''<br />
 +
'''[[number.of.loops]]'''<br />
 +
'''[[set.loop]]'''<br />
 +
'''[[set.loop.v]]'''<br />
 +
[[Category:Commands]]<br />

Latest revision as of 17:18, 29 March 2019

The current.loop command stores the number of the current loop of an object in a variable.

Syntax

current.loop(obj oA, var vB);

Remarks

Variable vB is set to the current loop number for object oA.

Possible Errors

AGI does not check that object number oA is a valid object. If it is not, the returned value is meaningless.

Example

Code:

<syntaxhighlight lang="agi"> current.loop(o0, v51); [ v51 now holds ego's current loop </syntaxhighlight>

Technical Information

Required Interpreter Version: Available in all AGI versions.
Byte-Code Value: 51 (0x33 hex)

See Also

current.cel
current.view
last.cel
number.of.loops
set.loop
set.loop.v