Skip to main content
GameDev.net gamedev.net
🔒 Locked

FORTRAN syntax qn.

Started by NickB Feb 1, 2004 at 4:49 PM 7 replies 900+ views
Original Post
NickB
NickB
Does anyone know what this does in FORTRAN 77 ?
       GO TO (330,320),INMR
 
INMR is a variable that is essentially random. My guess is that this is some kind of primitive switch statement (ie jump to line 330 or 320 on basis of the value of INMR), but I can''t find any references to it (including F95 Explained by Metcalf & Reid) - can anyone confirm/blow up my theory, or even better explain what it does do ... I''ve just spent the weekend doubled over a 90 page listing of unstructured code & am about ready to cry (forget the C# / C++ debate!)....
Cedric
Cedric
quote:
Original post by NickB
Does anyone know what this does in FORTRAN 77 ?

GO TO (330,320),INMR

Google found your answer.

Congratulation. It''s a switch!
quote:
I''ve just spent the weekend doubled over a 90 page listing of unstructured code & am about ready to cry
Let me guess... You''re a graduate student in physics or chemistry?
Ademan555
Ademan555
Heh, well its actually a bit more functional than a switch (well kinda, cant take characters im sure, but still the fact that its a simple goto gives u a bit more power), though gotos are considered bad practice anyways... does fortran have whiles and fors?
When General Patton died after World War 2 he went to the gates of Heaven to talk to St. Peter. The first thing he asked is if there were any Marines in heaven. St. Peter told him no, Marines are too rowdy for heaven. He then asked why Patton wanted to know. Patton told him he was sick of the Marines overshadowing the Army because they did more with less and were all hard-core sons of bitches. St. Peter reassured him there were no Marines so Patton went into Heaven. As he was checking out hi
Cedric
Cedric
quote:
Original post by Ademan555
Heh, well its actually a bit more functional than a switch (well kinda, cant take characters im sure, but still the fact that its a simple goto gives u a bit more power)
Goto powerful? Oh yeah; like a shotgun in a kitchen
quote:
does fortran have whiles and fors?
IIRC, not in its ''77 incarnation. They could be built out of if''s and goto''s, so they''re not needed

Cédric
Doc
Doc
I learned Fortran 77 so I could do a physics project. It worked out OK, but now I know why C was created (and I''m glad it was). ''77 sucks donkey balls, and I feel pity for anyone forced to use it.

Image loads when I''m online since I''m too lazy to find a permanent host.The following statement is true. The previous statement is false.
Shameless promotion:
FreePop: The GPL Populous II clone.

Ademan555
Ademan555
You mean a shotgun in a china shop :-), also the ifs and gotos, i knew that, thats all they are, theyre jsut more controlled... taking a few ounces of gunpowder out of your shotgun shells

[edited by - Ademan555 on February 2, 2004 1:11:00 AM]
When General Patton died after World War 2 he went to the gates of Heaven to talk to St. Peter. The first thing he asked is if there were any Marines in heaven. St. Peter told him no, Marines are too rowdy for heaven. He then asked why Patton wanted to know. Patton told him he was sick of the Marines overshadowing the Army because they did more with less and were all hard-core sons of bitches. St. Peter reassured him there were no Marines so Patton went into Heaven. As he was checking out hi
NickB
NickB
Thanks for your help guys!

quote:
Original post by Cedric
quote:
I''ve just spent the weekend doubled over a 90 page listing of unstructured code & am about ready to cry
Let me guess... You''re a graduate student in physics or chemistry?


Good guess, although not quite - Civil Engineering - the code is related to calculating earthquake hazard.

quote:

does fortran have whiles and fors?



It does have a couple of similar structs, for example there is a DO loop, eg:


DO 10 I=1,10

C Do something useful in a loop, eg print a message....
PRINT *,"Hello World ! ",I

10 CONTINUE

Ademan555
Ademan555
Wow thats ugly lookin, i feel sorry for yah lol
When General Patton died after World War 2 he went to the gates of Heaven to talk to St. Peter. The first thing he asked is if there were any Marines in heaven. St. Peter told him no, Marines are too rowdy for heaven. He then asked why Patton wanted to know. Patton told him he was sick of the Marines overshadowing the Army because they did more with less and were all hard-core sons of bitches. St. Peter reassured him there were no Marines so Patton went into Heaven. As he was checking out hi
NickB
NickB
Whats more, the observant amongst you will have noticed is that I inserted 1 to many spaces in the left-hand side (the left hand margin in F77 should be WS or a character - indicates a comment, 4 either WS or numbers - give line numbers & then another character or WS to indicate a continued line - total 6 columns....then anything written after column 72 is considered invalid too & some use for comments.....makes printing the code a real mess!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.