| AGET | |
| Syntax | AGET array number AGET array list |
| Explanation | AGET reports the value in a specific location of an array as specified by its inputs. The first element of input is the array to be accessed, while the second element specifies the array element to be obtained. For one-dimensional arrays, the second element may be a number starting from 0; for multi-dimensional arrays, the input element is a list of numbers, where each number stands for one dimension. Bytearrays always report numbers between 0 and 255 while other arrays report the value stored in the accessed element. If no value is stored, bytearrays report 0 while other arrays report an empty list []. |
| Examples | MAKE "A ARRAY [2 2] AGET :A [1 0] Result: [] ASET :A [1 1] [SQUARE 4] AGET :A [1 1] Result: [SQUARE 4] MAKE "B BYTEARRAY [2 2] AGET :B [1 0] Result: 0 ASET :B [1 1] 10 AGET :B [1 1] Result: 10 |