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.
Related Article: Fortran 90 help
is a Legacy Languages discussion thread by bgk111 that has 1 reply and was last updated 3 years ago.
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