- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Is there still no block commnet characters available (as in /* in c) in CVF 6.5?
Lien copié
8 Réponses
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Fortran is not C. Fortran has no "block comment". Unlike C, Fortran assumes that each line is a complete statement, unless a continuation indicator is used.
Steve
Steve
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
It's not hard to write a Visual Studio macro to comment out a selection block in the IDE's editor. The macro can be assigned to a toolbar button or keystroke. I posted an example some time ago.
hth,
John
hth,
John
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Stevo,
Your answer surprises me. There is nothing wrong with utility features even if martians thought of it. There is surely frequent need for disabling large sections of the code which can be done with block comments. As it is things are more difficult in fortran since it swtiched from C to ! adding a zillion shift keys to the barrage of keystyrokes to diasble a few consecutive lines.
Even if this is not in f95 standard it could have been implemented as an extension or perhaps the way wordperfect does it by hiding blocks as a "hidden comment" with a "bubble" marker.
Tim
Your answer surprises me. There is nothing wrong with utility features even if martians thought of it. There is surely frequent need for disabling large sections of the code which can be done with block comments. As it is things are more difficult in fortran since it swtiched from C to ! adding a zillion shift keys to the barrage of keystyrokes to diasble a few consecutive lines.
Even if this is not in f95 standard it could have been implemented as an extension or perhaps the way wordperfect does it by hiding blocks as a "hidden comment" with a "bubble" marker.
Tim
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Tim,
Actually, yes, there is something wrong with adding such an extension, where the language already provides an appropriate syntax. It serves to fracture the language and encourage users to write non-portable programs. Our philosophy is to invent extensions very cautiously, and then only when they are "in the spirit of Fortran" Block comments, which would be a radical shift in the way Fortran code is parsed, would not make the cut.
Steve
Actually, yes, there is something wrong with adding such an extension, where the language already provides an appropriate syntax. It serves to fracture the language and encourage users to write non-portable programs. Our philosophy is to invent extensions very cautiously, and then only when they are "in the spirit of Fortran" Block comments, which would be a radical shift in the way Fortran code is parsed, would not make the cut.
Steve
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
I use these VBA Macros:
This saves you having to select: just run the Begin/End around your block.
--
Gerry T.
Option Explicit Sub DECBeginCommentBlock() 'DESCRIPTION: Comment a block of code in a CVF source. dim strFunctionName strFunctionName = ActiveDocument.Selection if strFunctionName = "" Then ActiveDocument.Selection = "!DEC$ IF (.FALSE.)" & vbCrLf end if End Sub Sub DECEndCommentBlock() 'DESCRIPTION: End a comment block in a CVF source. dim strFunctionName strFunctionName = ActiveDocument.Selection if strFunctionName = "" Then ActiveDocument.Selection = "!DEC$ END IF" & vbCrLf end if End Sub
This saves you having to select: just run the Begin/End around your block.
--
Gerry T.
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Thanks GT,
Now if I only could figure out what a VBA macro is and where to put it.
Tim deBiped
Now if I only could figure out what a VBA macro is and where to put it.
Tim deBiped
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
GT,
Please disregard my hasty posting. I figured out how to use your Macro. I even assigned the smiley faces to begin and end.
As I understand it I run the "begin" macro at the beginning then put the cursor at the end of the block and runthe "end" macro. right?
Is is possible to repalce the strings :"!DEC...." with more a descriptive text?
Thanks again,
Tim
Please disregard my hasty posting. I figured out how to use your Macro. I even assigned the smiley faces to begin and end.
As I understand it I run the "begin" macro at the beginning then put the cursor at the end of the block and runthe "end" macro. right?
Is is possible to repalce the strings :"!DEC...." with more a descriptive text?
Thanks again,
Tim
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
You could do:
!DEC IF (.false) !Begin block
...
!DEC END IF !End block
Ciao,
Gerry T.
!DEC IF (.false) !Begin block
...
!DEC END IF !End block
Ciao,
Gerry T.
Répondre
Options du sujet
- S'abonner au fil RSS
- Marquer le sujet comme nouveau
- Marquer le sujet comme lu
- Placer ce Sujet en tête de liste pour l'utilisateur actuel
- Marquer
- S'abonner
- Page imprimable