You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _build/reference/1432-data-array.markdown
+14-9Lines changed: 14 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,8 @@
4
4
5
5
Creates a ARRAY or MAP variable from the given string or expression
6
6
7
-
<pre>
7
+
8
+
~~~
8
9
9
10
' See also Article "New features" -> "User defined structures".
10
11
Def uline(text) = Cat(2) + text + Cat(-2) ' Underline text
@@ -78,7 +79,7 @@ b.title = "Top-Left"
78
79
?:?:? " Press any key..."
79
80
Pause
80
81
81
-
</pre>
82
+
~~~
82
83
83
84
Thank you.
84
85
Ah, new stuff!
@@ -108,13 +109,14 @@ Here I quote Chris from Home -- Forums -- Project help -- Tile Map Editor:
108
109
<blockquote>
109
110
...
110
111
If you click File / Export and save the output in JSON format, you can then use the output in a SmallBASIC program like this:
111
-
<pre>
112
+
113
+
~~~
112
114
113
115
tload "map.json" , buffer, 1
114
116
tiles= array(buffer)
115
117
? tiles.layers(0).data(0)
116
118
117
-
</pre>
119
+
~~~
118
120
119
121
...
120
122
</blockquote>
@@ -123,7 +125,8 @@ That's useful but can it be applied to other ARRAY types? For example I can make
123
125
I've copy this code from JSON Wikipedia, it seems like JSON supports more then one
124
126
dimension according to the example...
125
127
The following example shows a possible JSON representation describing a person:
126
-
<pre>
128
+
129
+
~~~
127
130
128
131
{
129
132
"firstName": "John",
@@ -154,7 +157,7 @@ The following example shows a possible JSON representation describing a person:
154
157
"spouse": null
155
158
}
156
159
157
-
</pre>
160
+
~~~
158
161
159
162
This what Chris wrote at Home -- Forums -- Announcements (10/02/2014):
160
163
<blockquote>
@@ -175,7 +178,8 @@ Home -- Forums -- Project help -- Tile Map Editor -- coffee first...
175
178
It shows how easy is to save and load ordinary array with more than one dimension, by using the WRITE and READ keywords to save and load array variables in binary format.
176
179
I am trying to make a dictionary with two columns as part of writing an assembler. I can SEARCH the first column and use (0,1) then (1,1) to look up the second column if I REDIM the array loaded from a file.
177
180
But I cannot see a way to load the file with two dimensions.
178
-
<pre>
181
+
182
+
~~~
179
183
180
184
REM SmallBASIC
181
185
REM created: 03/04/2016
@@ -222,11 +226,12 @@ SEARCH i, "JEQ", r
222
226
? "jump = ",i(0,r)
223
227
? "binary = ",i(1,r)
224
228
225
-
</pre>
229
+
~~~
226
230
227
231
See: Home -- Language reference -- File -- TLOAD -- How to convert TLOAD's array into nested array
0 commit comments