Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29279 Discussions

IVF source editing question - locating code block starts/ends

longden_loo
Beginner
723 Views
In IVF, is there a way to locate the end of a given block structure (notably, IF...ENDIF) using the editor such asthe way other editors determine C/Java start/end by positioning the cursor on either end and pressing a "jump" key which takes the cursor to the other matchingstatement.
Another thought is if there is an option to highlight or otherwise colorize all the statements in a block?
Heavily nested code structures in Fortran have always been a time killer when they spread over several screens (hey, it's not necessarily my code :) Thx.
0 Kudos
4 Replies
Steven_L_Intel1
Employee
723 Views
Intel Visual Fortran does not supply such a feature, and the syntax of Fortran makes implementing something like that a bit harder than it is for Java and C.
0 Kudos
emc-nyc
Beginner
723 Views




longden.loo@sparta.com wrote:


In IVF, is there a way to locate the end of a given block structure (notably, IF...ENDIF).









The closest I've seen to what you're looking for are the f90 and fortran modes in emacs (either GNU emacs or Xemacs). You could try getting emacs (it's about an 18 MByte download) or Xemacs, and see if the f90 or fortran modes are close to what you need.
0 Kudos
longden_loo
Beginner
723 Views
Thanks. It turns out the VIM editor also has some kind of macro (called "matchit") written to support this function. Since I already use VIM (for other things), I might look into this since the needed macro is already packaged (but not activated by default).
0 Kudos
jim_dempsey
Beginner
723 Views
There is a simple trick I use in the Visual Studio.NET IDE. The IDE editor has some macros built in. One of which is to find the matching curly brace of a C/C++ program. Braces are not used in .F90 but that does not mean you are prohibited from using them within comments. Try
do I=1,foo ! {
...
! {
if(expr)
! {
...
! }
else
! {
....
! }
endif
! }
enddo ! }
This works for me. It does mean you have to be vigilent about inserting the braces.
Jim Dempsey
0 Kudos
Reply