0

I know by putting ! at the beginning of a line it will turn into comment. But how can I do that for a lot of lines? Of course I don't want to do that by putting ! line by line.

I'm using Fortran Powerstation.

Nina
  • 1
  • 3
  • BTW Powerstation is hopelesly obsolete, completely unsupported and well known to be full of bugs. I can't recommend using it in any way. – Vladimir F Героям слава Oct 27 '16 at 16:22
  • Current supported compilers have conditional compilation facility such as fpp or traffic. – tim18 Oct 27 '16 at 16:54
  • With emacs, we can use "M-x comment-region" after selecting the lines to be commented out. "M-x uncomment-region" does the opposite. Another (non-fpp) way might be to insert "if (.false.) then" and "endif" before and after the region... – roygvib Oct 27 '16 at 19:10

2 Answers2

0

There are no block comments in Fortran.

Read the manual of your text editor or IDE and find there how to comment and uncomment several lines at a time. In my editor (Kate) it is Ctr+D and Ctrl+Shift+D, for example. Your editor will be different.

In your Visual Studio try to press Ctrl + /.

0

There are editors out there that do it. I use Notepad ++. Bear in mind that this will place a "!" at the beginning of each line, but it allows you to select your block of text and do it all at once.

If you are referring to HTML-style commenting where you enclose your block with <-- /--> tags, I don't believe that is possible, but it has been a while since I worked with Fortran.

Pat Jones
  • 876
  • 8
  • 18
  • Yes, in Notpad++ hold down alt and drag the mouse. You can select a long column. When you type ! it will appear across all selected rows. – Mark S Oct 28 '16 at 06:13