$ TADA ARRAY1 Opening array1.text 1: -- SAMPLE TO DEMONSTRATE SIMPLE ARRAYS 1 of 4 2: 3: with TEXT_IO ; use TEXT_IO, INTEGER_IO, FLOAT_IO ; 4: procedure MAIN is 5: 6: -- dimension the array BALANCES with subscripts ranging form 1 to 20 7: -- and having each element of the array be a floating point number 8: 9: BALANCES : array ( 1..20 ) of FLOAT := ( 1..20 => 0.0 ) ; 10: 11: -- declare the variable OPEN_ACCOUNTS to be integer and initialized 12: -- to zero. This will be the number of entries used in the array. 13: 14: OPEN_ACCOUNTS : INTEGER := 0 ; 15: 16: begin 17: 18: -- zero out the array in execution 19: for I in 1..20 loop 20: BALANCES(I) := 0.0 ; 21: end loop ; 22: 23: -- increment the array pointer and put in data 24: OPEN_ACCOUNTS := OPEN_ACCOUNTS + 1 ; 25: BALANCES(OPEN_ACCOUNTS) := 1.5 ; 26: 27: -- any integer expression can be used as a subscript 28: BALANCES(OPEN_ACCOUNTS + 1) := 0.732_175E6 ; 29: -- note: floating point numbers can use scientific notation 30: -- but be sure to use at least one digit befor and after the point 31: 32: -- write out values 33: PUT(OPEN_ACCOUNTS) ; PUT_LINE(" accounts open.") ; 34: PUT(BALANCES(OPEN_ACCOUNTS)) ; PUT_LINE(" is balance."); 35: 36: end MAIN ; Compilation complete Syntax errors: 0 Semantic errors: 0 Lines compiled: 36 $ TRUN ARRAY1 1 accounts open. 1.5000000E+00 is balance.