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. |
− | + | == Syntax == | |
− | + | number.of.loops([[screen object|obj]] oA, [[variable|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 == | |
− | + | <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> | ||
− | == | + | == Technical Information == |
− | + | {| border="1" cellpadding="2" | |
− | + | | style="background-color: #efefef" width="200" | '''Required Interpreter Version:''' | |
− | + | | width="175" | Available in all AGI versions. | |
− | + | |- | |
+ | | style="background-color: #efefef" | '''Byte-Code Value:''' | ||
+ | | 53 (0x35 hex) | ||
+ | |} | ||
− | + | == See Also == | |
− | [[ | + | '''[[set.loop]]'''<br /> |
− | [[Category: | + | '''[[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) |