Hello,
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
ONE result:
D:\FORTRAN\CURSUS\F90\5>ftn95 if3.f90
[FTN95/WIN32 Ver. 2.00 Copyright(c) Salford Software Ltd 1993-2000]
Licensed to: Mr J. van Oosterwijk
Organisation: TU DELFT
0006) if: if( k > 3) then
WARNING - This construct label is the same name as a Fortran keyword -
possible misplaced ':'
NO ERRORS, 1 WARNING [<T_IF> FTN95/WIN32 v2.00]
[JvO] I agree with the warning;
[JvO] The programme was intended as an example of unrecommended use of
names that
are also keywords.
Second result
D:\FORTRAN\CURSUS\F90\5>f90 -c if3.f90
cf90-197 error on line 8 of if.f90: Unexpected syntax: "EOS" was expected
but fo
und "I".
f90: Copyright Absoft Corporation 1994-1998 mV2; Cray Research, Inc.
1994-1996
CF90 (2.x.x.x f36t87) Version 2.0 Wed Aug 9, 2000 17:10:38
f90fe: 13 source lines
f90fe: 1 Errors, 0 Warnings, 0 Other messages, 0 ANSI
[JvO] I don't agree with the error message.
[JvO] Standard F90 (8.1.2.1) states that an IF block can have a name
[JvO] This name may be used on the ELSE IF, ELSE and END IF statements.
This compiler seems to be eluded by the number of IF's.
--
Met vriendelijke groet,
/---
___ ___
/ / /
/__/ \/ /__/ .
Jan van Oosterwijk
Technische Universiteit Delft
Dienst Technische Ondersteuning
Postbus 354, 2600 AJ Delft
telefoon 015 - 278 50 17
fax 015 - 278 37 87
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|