59 lines
1.7 KiB
HTML
59 lines
1.7 KiB
HTML
<html>
|
|
<head>
|
|
<title>Blitz3D Docs</title>
|
|
<link rel=stylesheet href=../css/commands.css type=text/css>
|
|
</head>
|
|
<body>
|
|
<h1>New type_variable</h1>
|
|
<h1>Parameters</h1>
|
|
<table>
|
|
<tr>
|
|
<td>
|
|
type_variable = the actual Type name, not the custom Type name
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<h1>Description</h1>
|
|
<table>
|
|
<tr>
|
|
<td>
|
|
If you aren't familiar with the TYPE command, please refer to that before reading about this command.
|
|
|
|
<br />
|
|
|
|
<br />
|
|
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.
|
|
<br>
|
|
<br>
|
|
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>.
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<h1><a href=../2d_examples/New.bb>Example</a></h1>
|
|
<table>
|
|
<tr>
|
|
<td>
|
|
; Define the CHAIR Type
|
|
<br />
|
|
|
|
<br />
|
|
Type CHAIR
|
|
<br />
|
|
Field X
|
|
<br />
|
|
Field Y
|
|
<br />
|
|
Field HEIGHT
|
|
<br />
|
|
End Type
|
|
<br />
|
|
|
|
<br />
|
|
; Create 100 new chairs using FOR ... NEXT using the collection name of ROOM
|
|
<br />
|
|
|
|
<br />
|
|
For tempx = 1 to 10
|
|
<br />
|
|
For tempy = 1 to 10
|
|
<br />
|
|
room.chair = New Chair
|
|
<br />
|
|
room\x = tempx
|
|
<br />
|
|
room\y = tempy
|
|
<br />
|
|
room\height = Rnd(0,10) ; set a random height 0 to 10
|
|
<br />
|
|
Next
|
|
<br />
|
|
Next
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<br>
|
|
<a target=_top href=../index.htm>Index</a><br>
|
|
<br>
|
|
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>
|
|
</html>
|