Difference between revisions of "Last.cel"

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

Latest revision as of 16:44, 9 April 2019

The last.cel command stores the last cel number of a screen object's current loop in a variable.

Syntax

last.cel(obj oA, var vB);

Remarks

Variable vB is set to the last cel number for a screen object's current loop. Because the first cel is numbered 0, the last cel will be the cel count - 1.

Possible Errors

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

Example

Code:
last.cel(o0, v51);  [ v51 is set to last cel of ego's current loop

Technical Information

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

See Also

current.cel
current.loop
current.view
set.cel
set.cel.v