Anonymous user
Create a two-dimensional array at runtime: Difference between revisions
Create a two-dimensional array at runtime (view source)
Revision as of 10:11, 24 December 2014
, 9 years agono edit summary
No edit summary |
|||
Line 604:
In position 3 4 we have 20
</pre>
=={{header|ERRE}}==
In ERRE language arrays created at run-time is "dynamic arrays". For this task will be enough this code:
<lang>
PROGRAM DYNAMIC
'$DYNAMIC
DIM A%[10,10]
BEGIN
PRINT(CHR$(12);) !CLS
INPUT("Subscripts",A%,B%)
!$DIM A%[A%,B%]
A%[2,3]=6
PRINT("Value in row";2;"and col";3;"is";A%[2,3])
END PROGRAM
</lang>
You can redimension A% by using a !$RCODE="ERASE A%" with a subsequent !$DIM A%[.,.]
=={{header|Euphoria}}==
|