home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / fortran / 4364 < prev    next >
Encoding:
Text File  |  1992-11-19  |  1.6 KB  |  38 lines

  1. Newsgroups: comp.lang.fortran
  2. Path: sparky!uunet!cs.utexas.edu!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!eff!news.oc.com!convex!dodson
  3. From: Dave Dodson <dodson@convex.COM>
  4. Subject: Re: How does one return a logical value...???
  5. Originator: dodson@bach.convex.com
  6. Sender: usenet@news.eng.convex.com (news access account)
  7. Message-ID: <1992Nov19.154907.9758@news.eng.convex.com>
  8. Date: Thu, 19 Nov 1992 15:49:07 GMT
  9. Reply-To: dodson@convex.COM (Dave Dodson)
  10. References: <BxwrJC.GME@cs.uiuc.edu> <1edccoINNkab@early-bird.think.com>
  11. Nntp-Posting-Host: bach.convex.com
  12. Organization: Engineering, CONVEX Computer Corp., Richardson, Tx., USA
  13. X-Disclaimer: This message was written by a user at CONVEX Computer
  14.               Corp. The opinions expressed are those of the user and
  15.               not necessarily those of CONVEX.
  16. Lines: 20
  17.  
  18. >In article <BxwrJC.GME@cs.uiuc.edu>, ctaylor@cs.uiuc.edu (Conrad W Taylor) writes:
  19. >         IF (CheckActivity(previous, ROWS, COLS) .EQ.  .TRUE.) THEN
  20. >           uncontrol = uncontrol + 1
  21. >         ENDIF
  22. > My compiler says that I have mixed types when I use .TRUE. .  
  23.  
  24. The problem is that .EQ. does an arithmetic comparison.  If you
  25. want to do a logical comparison, use .EQV.:
  26.  
  27.      IF (CheckActivity(previous, ROWS, COLS) .EQV. .TRUE.) THEN
  28.  
  29. or, since CheckActivity (presumably) returns a logical value, just write
  30.  
  31.      IF (CheckActivity(previous, ROWS, COLS)) THEN
  32.  
  33. ----------------------------------------------------------------------
  34.  
  35. Dave Dodson                                     dodson@convex.COM
  36. Convex Computer Corporation      Richardson, Texas      (214) 497-4234
  37.