replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - Error in IF statement.
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 

Error in IF statement.

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



Joined: 21 Jul 2006
Posts: 24
Location: USA

PostPosted: Fri Sep 23, 2011 12:41 pm    Post subject: Error in IF statement. Reply with quote

I am getting the error "The condition in an IF statement should be logical".

IF (ETA(I)<0) THEN
HEIGHT(I)=ETA(I)
HEIGHT(I)=HEIGHT(I)*HUP(1,KI)
ELSE IF (ETA(I)=0) THEN
HEIGHT(I)=ETA(I)
ELSE
HEIGHT(I)=ETA(I)
HEIGHT(I)=HEIGHT(I)*HLO(1,KI)
END IF

Any idea what is wrong here?
Back to top
View user's profile Send private message
Jim



Joined: 21 Jul 2006
Posts: 24
Location: USA

PostPosted: Fri Sep 23, 2011 12:43 pm    Post subject: Addendum to IF statement. Reply with quote

I want to set ETA(I) to different values when the number is less than 0, equal to 0 and greater than 0.
Back to top
View user's profile Send private message
Wilfried Linder



Joined: 14 Nov 2007
Posts: 314
Location: D�sseldorf, Germany

PostPosted: Fri Sep 23, 2011 1:13 pm    Post subject: Reply with quote

To compare values, use either the traditional ".eq." or the modern "==". In your case:

Code:
...
else if (eta(i) == 0) then
...

Regards - Wilfried
Back to top
View user's profile Send private message
colt1954



Joined: 21 Dec 2010
Posts: 81

PostPosted: Wed Oct 12, 2011 6:31 pm    Post subject: Agree Reply with quote

Try IF (ETA(I) .EQ. 0.0) and IF(ETA(I) .LT. 0.0) etc
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 -> General 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