Re: printing logical variables as "true" and "false"
- From: "[JvO]" <jvo_36@xxxxxxxxxxx>
- Date: 29 Nov 2005 02:46:00 -0800
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
.
- References:
- printing logical variables as "true" and "false"
- From: beliavsky
- Re: printing logical variables as "true" and "false"
- From: Richard E Maine
- Re: printing logical variables as "true" and "false"
- From: *** Hendrickson
- Re: printing logical variables as "true" and "false"
- From: Richard E Maine
- Re: printing logical variables as "true" and "false"
- From: Richard E Maine
- Re: printing logical variables as "true" and "false"
- From: *** Hendrickson
- Re: printing logical variables as "true" and "false"
- From: James Van Buskirk
- Re: printing logical variables as "true" and "false"
- From: Nestor Grion
- Re: printing logical variables as "true" and "false"
- From: Richard Maine
- Re: printing logical variables as "true" and "false"
- From: Ron Shepard
- Re: printing logical variables as "true" and "false"
- From: David Flower
- printing logical variables as "true" and "false"
- Prev by Date: Re: Compaq Visual Fortran discontinued: upgrade to Intel Visual Fortran?
- Next by Date: Re: Compaq Visual Fortran discontinued: upgrade to Intel Visual Fortran?
- Previous by thread: Re: printing logical variables as "true" and "false"
- Next by thread: Re: printing logical variables as "true" and "false"
- Index(es):