Re: printing logical variables as "true" and "false"




David Flower schreef:



> Whilst this would have advantages, there is are significant downsides:
> - some coding errors would not be identified
> - there is a problem in situations like:
> INTEGER I
> DO I = 0, 2
> IF ( I ) THEN
> How does the compiler treat I=2 ? Does it:
> a) Error (involving extra code)
> b) Just look at the LSB
> c) Something else
> - Does I = .TRUE. set the LSB or I=1 ?
This you can't know (it's not in the Standard, maybe in the manual)

Anyway, the syntax in this case is
IF(INTEGER) L1, L2, L3
where L? are statement labels. So you should get a compile error. a)
Alternative:
IF(BTEST(I, 0)) THEN ! Maybe ?

[JvO]

> Dave Flower

.


Quantcast