22 lines
616 B
Plaintext
22 lines
616 B
Plaintext
* # Get user X,Y dimensions
|
|
output = 'Enter X,Y:'; xy = trim(input)
|
|
xy break(',') . x ',' rem . y
|
|
|
|
* # Define and create array, 1-based
|
|
arr = array(x ',' y) ;* Or arr = array(xy)
|
|
|
|
* # Display array prototype
|
|
output = 'Prototype: ' prototype(arr)
|
|
|
|
* # Assign elements, angle or square brackets
|
|
* # Same array can hold ints, strings, etc.
|
|
arr<x,y> = 99; arr[1,1] = 'dog'
|
|
|
|
* # Display elements
|
|
output = 'arr[' xy '] = ' arr[x,y]
|
|
output = 'arr[1,1] = ' arr[1,1]
|
|
|
|
* # Release array for garbage collection
|
|
arr =
|
|
end
|