Example 5.159. Array class - examples
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
Example 5.161. Array class - examples
directions=.array~of("North","South", ,"West") do i=1 to 4 /* Produces: North */ say directions[i] /* South */ /* The NIL object */ end /* West */
Example 5.162. Array class - examples
z=.array~of(1,2,3)~~put(4,4) do i = 1 to z~size say z[i] /* Produces: 1 2 3 4 */ end