home *** CD-ROM | disk | FTP | other *** search
/ A.N.A.L.O.G. Magazine 1985 October / 85_oct.atr / online6.act < prev    next >
Text File  |  2023-02-26  |  727b  |  1 lines

  1. ¢MODULE  ; Example 6¢¢; Declare our individual arrays:¢¢BYTE ARRAY¢  one()   = [ 1, 2, 3 ],¢  two()   = [ 4, 5, 6 ],¢  three() = [ 7, 8, 9 ]¢¢; Declare a dummy PROC with the¢; addresses of the BYTE ARRAYs:¢¢PROC dummy=*() [ one two three ]¢¢; MODULE statement because we're¢; declaring a variable:¢¢CARD ARRAY¢  ary_of_arys = dummy¢¢; Now, our main procedure, which¢; illustrates how to access our¢; doubly subscripted arrays:¢¢PROC main()¢BYTE i, j¢BYTE ARRAY bary¢¢  ; loop for first subscript:¢  FOR i = 0 TO 2 DO¢¢    ; fetch address of array:¢    bary = ary_of_arys(i)¢¢    ; loop for second subscript:¢    FOR j = 0 TO 2 DO¢      PrintF("Array(%U)(%U) = %U%E",¢              i, j, bary(j))¢    OD¢    PutE()¢  OD¢RETURN¢¢