forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Compiling of logical tests

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
Greg100



Joined: 04 Jul 2016
Posts: 2

PostPosted: Mon Jul 04, 2016 8:13 pm    Post subject: Compiling of logical tests Reply with quote

I am just returning to FORTRAN after 40 years so the question may be silly. I set up a logical test

If (a<=c) then
(do something)
end if.

It does not compile properly but

If (a .le. c) then
(do something)
end if

Compiles with no problem. Have I just been away too long? Help!
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 1886

PostPosted: Tue Jul 05, 2016 1:56 am    Post subject: Reply with quote

Which compiler did you use, and what options did you specify? What do you mean by "did not compile properly"?

I tried this program with FTN95 7.2, and it worked fine:

Code:
program xle
implicit none
real a,b,c
a=5.0
c=7.0
if(a<=c)then
   b=a-c
   write(*,*)b
endif
end
Back to top
View user's profile Send private message
Greg100



Joined: 04 Jul 2016
Posts: 2

PostPosted: Thu Jul 07, 2016 6:04 pm    Post subject: Reply with quote

Sorry for the long delay. Thank you for the quick response mecej4. It was pure brain fade on my part. Clearly If (a = 1) then is an incorrect logical and should be If (a == 1) then ... It is surprising me how slowly FORTRAN is coming back to me but I will get there. I turn 80 next year and am planning on using it for the next 20 years.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group