FTN95 compiles the following subroutine code with only a warning.
integer function cbd ()
character*(MaxLng) text
cbd = len(text)/2
return
end
The code is in error because the length specifier for the variable 'text' is neither a constant nor a dummy argument. The function is an external function, so there is no question of MaxLng being available by host or USE association.
For the same code, FTN77 says
0002) character*(MaxLng) text
*** A constant expression must be used in this case
*** A constant expression must be used in this case
0003) cbd = len(text)/2
*** LEN is an intrinsic function used with invalid argument(s)
3 ERRORS [<CBD>FTN77 Ver 4.03]
This compiler bug is at the heart of the rather long and devious discussion in a recent thread, 'Attributes of File', at https://forums.silverfrost.com/Forum/Topic/2746