Nested function: Difference between revisions

m
Line 333:
 
===Containerisation===
With the advent of F90 comes the CONTAINS statement, whereby within a function (or subroutine) but oddly, at its ''end'' (but before its END) appears the key word CONTAINS, after which further functions (and subroutines) may be defined in the established manner. These have access to all the variables defined in the containing routine, though if the contained routine declares a name ofused in the containing routine then that outside name becomes inaccessible.
 
Such contained routines are not themselves allowed to contain routines, so that the nesting is limited to two levels - except that arithmetic statement functions are available, so that three levels could be employed. Languages such as Algol, pl/i, Pascal, etc. impose no such constraint. <lang Fortran> SUBROUTINE POOBAH(TEXT,L,SEP) !I've got a little list!
1,220

edits