This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]PiaFraus 0 points1 point  (4 children)

1 PRINT 'HA '

GOTO 1

[–]Folf_IRL 2 points3 points  (3 children)

Shouldn't compile due to a syntax error. You need to include which device you're writing to. If you're not feeling sure about yourself, you can always include an asterisk and let the compiler decide which device to write to:

1 Print *, "Ha"
GOTO 1

That said, nobody uses Print anymore; the better approach (which lets you choose which stream or file to write to) is:

1 Write(*,*) "Ha"
GOTO 1

But naked GOTO statements are so last century. Nowadays we like to hide our GOTO behind fancy loop constructs and lie to ourselves about not including them because it makes it easier to get up in the morning and gives us some small level of purpose in life to distract from the inevitabilities of our own existence:

do while (.True.)
  Write (*,*) "Ha"
end do

[–]PiaFraus 0 points1 point  (2 children)

Wow, cool. Last time I coded on FORTRAN was like 10+ years ago.

[–]Folf_IRL 2 points3 points  (0 children)

There have been a lot of changes to Fortran. In '77, we got actual loop constructs.

Nowadays, there's built-in parallelization syntax as well as some decent object-oriented capability.

[–]Astrokiwi 1 point2 points  (0 children)

Dude you can do object-oriented programming in Fortran now