Anonymous user
Creating an Array: Difference between revisions
→[[Forth]]
(→[[D]]: Added Forth language entry) |
|||
Line 155:
==[[Forth]]==
[[Category:Forth]]
Forth has a variety of ways to allocate arrays of data, though it has no built-in array handling words, favoring pointer manipulation.
Static array of 200 cells, uninitialized:
create MyArray 200 cells allot
here MyArray - cell / constant MyArraySize
Static array containing the numbers 1 to 5
create MyArray 1 , 2 , 3 , 4 , 5 ,
here MyArray - cell / constant MyArraySize
Dynamic array allocation:
0 value MyArray
200 cells allocate to MyArray
Dynamic array free:
MyArray free
0 to MyArray
==[[IDL]]==
|