array1=.array~of(1,2,3,4) /* Loads the array */
/* Alternative way to create and load an array */
array2=.array~new(4) /* Creates array2, containing 4 items */
do i=1 to 4 /* Loads the array */
array2[i]=i
end
do i=1 to 4
say array1[i]
end
directions=.array~of("North","South", ,"West")
do i=1 to 4 /* Produces: North */
say directions[i] /* South */
/* The NIL object */
end /* West */
z=.array~of(1,2,3)~~put(4,4)
do i = 1 to z~size
say z[i] /* Produces: 1 2 3 4 */
end