Print

Print


> A problem I have had more than once, but most recently using xlf:
> The following statement
>       IF (K.GT.0 .AND. X(K).GT.0.) THEN
> produces an error condition when K=0 and X is dimensioned in a normal way,
> i.e., 0 is an invalid subscript for X.
> 
> My question is whether this behavior is a violation of the FORTRAN standard.
> 

It can evaluate any mathematically equivalent expression or evaluate
as much of the expression as required to determine the result.
There is no shortcut behaviour as there is with ANSI C.

You should explicitly separate the tests.

Harvey


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%