forked from LegoGMI/ManualeGM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path401_07_arrays.html
43 lines (36 loc) · 1.01 KB
/
401_07_arrays.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Arrays</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>Arrays</h3>
You can use 1- and 2-dimensional arrays in GML. Simply put the index
between square brackets for a 1-dimensional array, and the two indices
with a comma between them for 2-dimensional arrays. At the moment you use
an index the array is generated. Each array runs from index 0. So be
careful with using large indices because memory for a large array will be
reserved. Never use negative indices. The system puts a limit of 32000 on
each index and 1000000 on the total size. So for example you can write the
following:
<p>
<blockquote>
<pre>
{
a[0] = 1;
i = 1;
<b>while</b> (i < 10) { a[i] = 2*a[i-1]; i += 1;}
b[4,6] = 32;
}
</pre>
</blockquote>
<!--END-->
</body>
</html>
<!-- KEYWORDS
arrays
2-dimensional arrays
1-dimensional arrays
-->