|
| 1 | +REM test @arr(x, y) for GLOBAL scope |
| 2 | + |
| 3 | +#include "lib/tst_framework.bas" |
| 4 | +INIT("Testing @ARRAY(a, b, c...)") |
| 5 | + |
| 6 | +DIM aglobal(2, 2) as UByte => {{0, 1, 2}, {3, 4, 5}, {6, 7, 8}} |
| 7 | +PRINT aglobal(1, 1); " -> "; |
| 8 | +POKE @aglobal(1, 1), 99 |
| 9 | +PRINT aglobal(1, 1); " "; |
| 10 | +SHOW_RESULTLN(aglobal(1, 1) = 99) |
| 11 | + |
| 12 | + |
| 13 | +SUB test1 |
| 14 | + REM test @arr(x, y) for LOCAL scope |
| 15 | + DIM alocal(2, 2) as UByte => {{0, 1, 2}, {3, 4, 5}, {6, 7, 8}} |
| 16 | + PRINT alocal(1, 1); " -> "; |
| 17 | + POKE @alocal(1, 1), 99 |
| 18 | + PRINT alocal(1, 1); " "; |
| 19 | + SHOW_RESULTLN(alocal(1, 1) = 99) |
| 20 | +END SUB |
| 21 | +test1 |
| 22 | + |
| 23 | + |
| 24 | +DIM aglobal1(2, 2) as UByte => {{0, 1, 2}, {3, 4, 5}, {6, 7, 8}} |
| 25 | +SUB test2(alocal() as UByte) |
| 26 | + REM test @arr(x, y) for PARAM scope |
| 27 | + PRINT alocal(1, 1); " -> "; |
| 28 | + POKE @alocal(1, 1), 99 |
| 29 | + PRINT alocal(1, 1); " "; |
| 30 | + SHOW_RESULTLN(alocal(1, 1) = 99) |
| 31 | + |
| 32 | +END SUB |
| 33 | +test2(aglobal1) |
| 34 | + |
| 35 | +FINISH |
0 commit comments