954,557 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

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.

levinia-heks
Newbie Poster
2 posts since Apr 2008
Reputation Points: 10
Solved Threads: 0
 
levinia-heks
Newbie Poster
2 posts since Apr 2008
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You