Manipulating arrays

How to push, pop and split arrays.

Example 1. Manipulating arrays

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
Import sodaware.blitzmax_array
 
Local test:String[] = ["One", "Two", "Three"]
 
' ----------
' - Pull off the start of the array.
 
Print Array_Pull(test).ToString()
'=> "One"
 
' Array now contains:
'=> ["Two", "Three"]
 
 
' ----------
' - Pop off the end of the array.
 
Print Array_Pop(test).ToString()
'=> "Three"
 
' Array now contains:
'=> ["Two"]
 
 
' ----------
' - Add a new item to the end of the array.
 
Local new_test:String[] = Array_Append(test, "Three")
' Array now contains:
'=> ["Two", "Three"]