We're a community of 1076K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,075,621 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Fortran newbie: end program in if-statement

I need to code a very basic fortran program that takes command line input, and I'd like to terminate the program if I detect wrong input. The following doesn't work:

if (n .NE. 5) then
	write (*,*) "Wrong number of arguments"
	end program Poker
end if

I get "Error: Expecting END IF statement at (1)", where (1) is at "end program Poker", which makes sense, but I have no idea how to jump to "end program" then. I'd rather not enclose the whole program in an if-statement, so if there's any other way, I'd appreciate it a lot if someone could point me in the right direction.

1
Contributor
1
Reply
2 Days
Discussion Span
2 Years Ago
Last Updated
2
Views
Question
Answered
levinia-heks
Newbie Poster
2 posts since Apr 2008
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
levinia-heks
Newbie Poster
2 posts since Apr 2008
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
Question Self-Answered as of 2 Years Ago

This question has already been solved: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.0817 seconds using 2.63MB