Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

commenting and uncommenting sections of code in Compaq Visual Fortran

Status
Not open for further replies.

efoss

Technical User
Nov 27, 2005
16
0
0
US
Does anyone know how to comment and uncomment sections of code in Compaq Visual Fortran?

Thanks.

Eric
 
Hi Zeitghost,

I just mean selecting a block of code and having a ! put at the start of each line. It seems like a pretty normal IDE function, but I can't figure out how to do it.

Thanks.

Eric
 
Depends on which Visual Studio are you using.

On 2003/2005, select you code then click Edit/Advanced/Comment Selection

On Visual 6, you have to create a macro to do it.
 
Why VS macros? There are conditional compilation directives in Compaq Visual Fortran:
Code:
!DEC IF (.FALSE.)
commented code block
!DEC ENDIF
(or !MS instead of !DEC).
As a rule, every Fortran implementation has its own conditional compilation features. Alas, no standard block comment in Fortran.
 
Sorrry, must be
Code:
!DEC$ IF (.FALSE.)
commented code block
!DEC$ ENDIF
 
Thanks all. I'll look into the macros, though I was hoping that there would be something really simple.

I'm using Compaq Visual Fortran, version 6.6. I also have MS Visual Studio 2005 on the same machine, though I haven't figured out much about how to use it. One thing I don't understand is the relationship between Visual Studio 2005 and Compaq Visual Fortran. The only time I see them functionally linked is when I screw up a Fortran program and then it says something like "sorry, this program had to quit" and I have a choice of clicking "debug" or "end now". If I click "debug", it gives me the option of debugging using Visual Studio 2005. I never choose that because I have learned to use the Compaq Visual Fortran debugger a bit now, and as I understand it, Visual Studio 2005 is not capable of compiling Fortran code. Why Compaq has the same icon for Compaq Visual Fortran as Microsoft has for MS Visual Studio 2005 remains a mystery to me ....

Sorry to ramble on. I'm a total beginner trying to pick up some of these things for work, but working in lab full of molecular biologists where noone knows the first thing about programming. Till now I've used Perl a lot, but that's it. Diving into this stuff seems significantly more complicated to me.

Eric
 
I've only ever used it when it was IVF. Never used CVF but they're probably the same thing.

IVF should just plugin into VS2005. If you create a new program using VS2005, in Fortran will be one of the options. The logo is an F in a blue square. To do this properly, install VS2005 before IVF. You can then use VS2005 as an IDE.

Having said that, I normally use vim and work most things off the command line because that is what I'm used to.
 
Thanks, xwb.

I had installed Compaq Visual Fortran before installing Visual Studio 2005. I can try to uninstall both of them and then reinstall VS2005 before CVF. If I do this, am I safe to not lose CVF files? I assume that uninstalling a program leaves files that I generated with that program untouched.

Eric
 
Yes - generated files will remain untouched. All you need to do is uninstall CVF and then reinstall it. If it still doesn't work then do both.

VS2005 is a pain to reinstall because it is not just VS2005. VS2005 SP1 takes just as long to install and you need to add permissions to drives and patches to your OS. You don't need SP1 if you're just using it for Fortran.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top