For Programmers: Free Programming Magazines  


Home > Archive > Fortran > November 2005 > Re: printing logical variables as "true" and "false"









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: printing logical variables as "true" and "false"
Ron Shepard

2005-11-29, 7:01 pm

In article <1133253978.442583.140800@g14g2000cwa.googlegroups.com>,
"David Flower" <DavJFlower@AOL.COM> wrote:

> INTEGER I
> DO I = 0, 2


When I mentioned using logical variables as do-loop variables and
array indices, I meant something more like

logical :: i
integer :: array(.false.,.true.)
do i = .false, .true. ! or 0,1 or whatever.
j = array(i) ! arbitrary expression
...

You can write code that looks sort of like this now, but you have to
define your own integer TRUE and FALSE values, along with the
appropriate integer<-->logical mapping functions. It just seems
like it would have simplified a lot of code to have standardized
this back in 1977.

$.02 -Ron Shepard
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com