Re: Standard pre-processing ?
- From: Joe Krahn <krahn@xxxxxxxxxxxxx>
- Date: Mon, 27 Feb 2006 14:52:58 -0500
David Flower wrote:
kis wrote:Most Fortran compilers include a built-in compile flag for a C preprocessor. This allows you to comment out a large block with:
Hi,
I use CVF 6.6 editor to write Fortran code and want to comment out (put
" ! or C " at the beginning of) hundreds of lines. Is there an easy
way to do that? What I did so far is to put the comment signs line by
line; very tedious and time consuming. FYI, in MATLAB (6.0 or higher),
simply block the lines that need to be commented out and press CTRL+R
simultaneously. All the blocked lines will be commented out (with %
sign).
Look forward to kind help.
Irfan
I am aware of at least three non-standard pre-processor command formats
(C, DEC, Salford).
Is there anything proposed, or implemented, in the standards ?
Dave Flower
#if 0
....
#endif
For inserting actual Fortran comments, you could use gVim: highlight a block, then do :s/^/!/
which means substitute beginning-of-line with '!'. The beginning-of-line is zero-width, so it;s really an insert.
COCO is an 'official' preprocessor, an actual ISO standard. However, it never has caught on, probably because the C preprocessor (in traditional mode) was already very common. Also, the are several FPP's, which are just C preprocessors that are better at handling Fortran source.
There is also a Perl-based preprocessor, fpx3. It is overkill for most users, but can also do simple cpp-like code exclusions.
Joe
.
- References:
- Easy way to put Comment in CVF
- From: kis
- Standard pre-processing ?
- From: David Flower
- Easy way to put Comment in CVF
- Prev by Date: Re: Converting fixed-to-free format
- Next by Date: Re: Converting fixed-to-free format
- Previous by thread: Re: Standard pre-processing ?
- Next by thread: Re: Standard pre-processing ?
- Index(es):
Relevant Pages
|
|