>
> Could anyone of you tell me if it is allowed to use the same name for
> a Contruct name and a variable name (in the same scoping unit of course).
I agree with Richard Maine. It is not allowed. See also half way down
M&R page 91.
> >From different compilers I get contradicting results:
>
>
> ! [JvO] 2000-08-09 IF.f90
> program T_IF
> k = 1 ; if = 2
>
> if: if(if > 3) then
>
> else
>
> end if if
>
> end program T_IF
Invalid and your compiler should tell you so.
> I tried the following, while studying SCOPE of names:
>
> !! [JvO] 2000-08-09 IF3.f90
> program T_IF
> implicit NONE
> integer :: k = 1
>
> if: if( k > 3) then
> k = -1
> else if if
> k = 0
> end if if
>
> end program T_IF
The problem here is that the else statement should be
else if
Hope this helps.
John Reid.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|