Last.htm 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <html>
  2. <head>
  3. <title>Blitz3D Docs</title>
  4. <link rel=stylesheet href=../css/commands.css type=text/css>
  5. </head>
  6. <body>
  7. <h1>Last type_variable</h1>
  8. <h1>Parameters</h1>
  9. <table>
  10. <tr>
  11. <td>
  12. type_variable = the actual Type name, not the custom Type name
  13. </td>
  14. </tr>
  15. </table>
  16. <h1>Description</h1>
  17. <table>
  18. <tr>
  19. <td>
  20. If you haven't read up on the TYPE command, you might want to do so before continuing. <br />
  21. <br />
  22. Use this to assign a custom Type object to the last object in the collection. See the example.
  23. <br>
  24. <br>
  25. See also: <a class=small href=Type.htm>Type</a>, <a class=small href=New.htm>New</a>, <a class=small href=Before.htm>Before</a>, <a class=small href=After.htm>After</a>, <a class=small href=First.htm>First</a>, <a class=small href=Each.htm>Each</a>, <a class=small href=Insert.htm>Insert</a>, <a class=small href=Delete.htm>Delete</a>.
  26. </td>
  27. </tr>
  28. </table>
  29. <h1><a href=../2d_examples/Last.bb>Example</a></h1>
  30. <table>
  31. <tr>
  32. <td>
  33. ; Define a crafts Type <br />
  34. <br />
  35. Type crafts <br />
  36. Field x <br />
  37. Field y <br />
  38. Field dead <br />
  39. Field graphic <br />
  40. End Type <br />
  41. <br />
  42. ; Create 100 crafts, with the unique name of alien <br />
  43. For t = 1 To 100 <br />
  44. alien.crafts = New crafts <br />
  45. alien\x = Rnd(0,640) <br />
  46. alien\y = Rnd(0,480) <br />
  47. alien\dead = 0 <br />
  48. alien\graphic = 1 <br />
  49. Next <br />
  50. <br />
  51. ; Move to the first object <br />
  52. alien.crafts = First crafts <br />
  53. <br />
  54. Print alien\x <br />
  55. Print alien\y <br />
  56. Print alien\dead <br />
  57. Print alien\graphic <br />
  58. <br />
  59. ; move to the next alien object <br />
  60. alien = After alien <br />
  61. <br />
  62. Print alien\x <br />
  63. Print alien\y <br />
  64. Print alien\dead <br />
  65. Print alien\graphic <br />
  66. <br />
  67. ; move to the last alien object <br />
  68. alien.crafts = Last crafts <br />
  69. <br />
  70. Print alien\x <br />
  71. Print alien\y <br />
  72. Print alien\dead <br />
  73. Print alien\graphic <br />
  74. <br />
  75. ; move to the second to the last alien object <br />
  76. alien = Before alien <br />
  77. <br />
  78. Print alien\x <br />
  79. Print alien\y <br />
  80. Print alien\dead <br />
  81. Print alien\graphic
  82. </td>
  83. </tr>
  84. </table>
  85. <br>
  86. <a target=_top href=../index.htm>Index</a><br>
  87. <br>
  88. Click <a href=http://www.blitzbasic.co.nz/b3ddocs/command.php?name=Last&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
  89. </html>