Files
BlitzNext/_release/help/commands/2d_commands/Last.htm
T
2014-02-26 16:08:39 +13:00

44 lines
2.2 KiB
HTML

<html><head><title>Command: Last </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;Last type_variable&nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Move the Last object pointer to the Last object in the collection.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>type_variable = the actual Type name, not the custom Type name</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>If you haven't read up on the <a href='TYPE.htm'>TYPE</a>
command, you might want to do so before continuing.</p>
<p>Use this to assign a custom Type object to the last object in the collection.
See the example.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; Define a crafts Type</p>
<p>Type crafts<br>
Field x<br>
Field y<br>
Field dead<br>
Field graphic<br>
End Type</p>
<p>; Create 100 crafts, with the unique name of alien<br>
For t = 1 To 100 <br>
alien.crafts = New crafts<br>
alien\x = Rnd(0,640)<br>
alien\y = Rnd(0,480)<br>
alien\dead = 0<br>
alien\graphic = 1<br>
Next</p>
<p>; Move to the first object<br>
alien.crafts = First crafts</p>
<p>Print alien\x<br>
Print alien\y<br>
Print alien\dead<br>
Print alien\graphic</p>
<p>; move to the next alien object<br>
alien = After alien</p>
<p>Print alien\x<br>
Print alien\y<br>
Print alien\dead<br>
Print alien\graphic</p>
<p>; move to the last alien object<br>
alien.crafts = Last crafts</p>
<p>Print alien\x<br>
Print alien\y<br>
Print alien\dead<br>
Print alien\graphic</p>
<p>; move to the second to the last alien object<br>
alien = Before alien</p>
<p>Print alien\x<br>
Print alien\y<br>
Print alien\dead<br>
Print alien\graphic<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>