Difference between revisions of "Number.of.loops"

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

Latest revision as of 18:29, 12 April 2019

The number.of.loops command stores the number of loops in an object's assigned view in a variable.

Syntax

number.of.loops(obj oA, var vB);

Remarks

Variable vB is set to the number of loops in the view assigned to screen object oA.

Possible Errors

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

Example

Code:

<syntaxhighlight lang="agi"> animate.obj(o1); load.view(2); [ load and set.view(o1, 2); [ assign a view number.of.loops(o1, v51); [ v51 now equals number of loops in view 2 </syntaxhighlight>

Technical Information

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

See Also

set.loop
set.loop.v
current.loop