New.htm 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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>New 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 aren't familiar with the TYPE command, please refer to that before reading about this command. <br />
  21. <br />
  22. Creates a NEW object in a Type collection. Each call to this command automatically inserts a new object into the specified Type collection. Check the example and other Type commands for more information.
  23. <br>
  24. <br>
  25. See also: <a class=small href=Type.htm>Type</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=Last.htm>Last</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/New.bb>Example</a></h1>
  30. <table>
  31. <tr>
  32. <td>
  33. ; Define the CHAIR Type <br />
  34. <br />
  35. Type CHAIR <br />
  36. Field X <br />
  37. Field Y <br />
  38. Field HEIGHT <br />
  39. End Type <br />
  40. <br />
  41. ; Create 100 new chairs using FOR ... NEXT using the collection name of ROOM <br />
  42. <br />
  43. For tempx = 1 to 10 <br />
  44. For tempy = 1 to 10 <br />
  45. room.chair = New Chair <br />
  46. room\x = tempx <br />
  47. room\y = tempy <br />
  48. room\height = Rnd(0,10) ; set a random height 0 to 10 <br />
  49. Next <br />
  50. Next
  51. </td>
  52. </tr>
  53. </table>
  54. <br>
  55. <a target=_top href=../index.htm>Index</a><br>
  56. <br>
  57. Click <a href=http://www.blitzbasic.co.nz/b3ddocs/command.php?name=New&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
  58. </html>