September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
|
|
@ -1,20 +0,0 @@
|
|||
PROC array_test = VOID:
|
||||
(
|
||||
[1:20]INT a;
|
||||
a := others; # assign whole array #
|
||||
a[1] := -1; # assign individual element #
|
||||
a[3:5] := (2, 4, -1); # assign a slice #
|
||||
[1:3]INT slice = a[3:5]; # copy a slice #
|
||||
|
||||
REF []INT rslice = a[3:5]; # create a reference to a slice #
|
||||
print((LWB rslice, UPB slice)); # query the bounds of the slice #
|
||||
rslice := (2, 4, -1); # assign to the slice, modifying original array #
|
||||
|
||||
[1:3, 1:3]INT matrix; # create a two dimensional array #
|
||||
REF []INT hvector = matrix[2,]; # create a reference to a row #
|
||||
REF []INT vvector = matrix[,2]; # create a reference to a column #
|
||||
REF [,]INT block = matrix[1:2, 1:2]; # create a reference to an area of the array #
|
||||
|
||||
FLEX []CHAR string := "Hello, world!"; # create an array with variable bounds #
|
||||
string := "shorter" # flexible arrays automatically resize themselves on assignment #
|
||||
)
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
DEF ai[100] : ARRAY OF CHAR, -> static
|
||||
da: PTR TO CHAR,
|
||||
la: PTR TO CHAR
|
||||
|
||||
PROC main()
|
||||
da := New(100)
|
||||
-> or
|
||||
NEW la[100]
|
||||
IF da <> NIL
|
||||
ai[0] := da[0] -> first is 0
|
||||
ai[99] := da[99] -> last is "size"-1
|
||||
Dispose(da)
|
||||
ENDIF
|
||||
-> using NEW, we must specify the size even when
|
||||
-> "deallocating" the array
|
||||
IF la <> NIL THEN END la[100]
|
||||
ENDPROC
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
set empty to {}
|
||||
set ints to {1, 2, 3}
|
||||
|
|
@ -1 +0,0 @@
|
|||
set any to {1, "foo", 2.57, missing value, ints}
|
||||
Loading…
Add table
Add a link
Reference in a new issue