Array: Difference between revisions

4 bytes removed ,  7 years ago
m
(→‎Pascal: Add Fortran.)
Line 54:
With F90 came the standardisation of many expanded facilities. Arrays can be defined with any lower bound instead of just one, as in <code>REAL A(1951:2017)</code>, and with it now possible to define compound types, there can be arrays of such aggregates. Type matching remains strict, however. There is also much greater flexibility in manipulating arrays without explicit looping. The assignment above could be done via <code>A(3:1:-1) = 1.1</code> or, more normally, by <code>A(1:3) = 1.1</code> Similarly, there are additional functions applicable to arrays; <code>MAXLOC(A)</code> returns the index of the (first encountered?) maximum value of the array, but there is still no extension for INDEX.
 
Array sizes are no longer always fixed at compile time: on entry to a subroutine or function it can declare an array of a size determined by that occasion (as in Algol since the 1960s), and arrays can be explicitly allocated and de-allocated storage according to program logic. But, their type and the dimensionality remain fixed.
 
===[[Pascal]]===
1,220

edits