Code Comments
Programming Forum and web based access to our favorite programming groups.during modification of my code I sometimes like to ignore large part of code there must be a better way then putting !!!!! sign before every line :-) Thanks!
Post Follow-up to this message"Gertjan Spierenburg" <Spier75@hotmail.com> writes: > during modification of my code I sometimes like to ignore large part of co de > there must be a better way then putting !!!!! sign before every line :-) > > Thanks! logical :: extracode = .false. if(extracode) then <Your code here> end if -- Gareth Owen There ain't no sanity clause
Post Follow-up to this messageGareth Owen wrote: > > "Gertjan Spierenburg" <Spier75@hotmail.com> writes: > > > logical :: extracode = .false. > > if(extracode) then > > <Your code here> > > end if If your existing code compiles during modification. Otherwise, see if your compiler supports conditional compilation directives. While not standard, many have such extensions.
Post Follow-up to this messageDuane Bozarth <dpbozarth@swko.dot.net> writes: > Otherwise, see if your compiler supports conditional compilation > directives. While not standard, many have such extensions. And others have a flag that cause the C-preprocessor to be run on files firs t. -- Gareth Owen Font-o-Meter! Proportional Monospaced ^
Post Follow-up to this messageGareth Owen wrote: > "Gertjan Spierenburg" <Spier75@hotmail.com> writes: > > > > > logical :: extracode = .false. > > if(extracode) then > > <Your code here> > > end if > I use/mix both schemes. Every now and then when I strip the leading "!"s I discover that some intermediate change has left me with a syntax error. That never happens when using the "if ( .false. )" but then I do sometimes have syntax errors in the nonexecuted portions. It is mostly a choice of when you want the blunders exposed as well as how much code is involved. The "if ( .false. )" style has the merit that that it can be changed into a dynamic switch that can be set either after some event (like when a trouble only shows up after 35000 iterations or so) or by reading a parameter (so you can see the internals after a user has complained about silly output).
Post Follow-up to this messageGertjan Spierenburg wrote: > during modification of my code I sometimes like to ignore large part of co de > there must be a better way then putting !!!!! sign before every line :-) > > Thanks! > > One of the neat little things in Photran is a pull down with "Comment" and "Uncomment" selections. Just select the block of code and click. Of course, you still get ! in front of every line, but it is easy to do (and undo). -- Walt Brainerd +1-877-355-6640 (voice & fax) The Fortran Company +1-520-760-1397 (outside USA) 6025 N. Wilmot Road walt@fortran.com Tucson, AZ 85750 USA http://www.fortran.com
Post Follow-up to this messageGertjan Spierenburg wrote: > During modification of my code, > I sometimes like to ignore large part of code. > There must be a better way then putting ! sign before every line. > cat f.f90 subroutine f() if (.false.) then print *, 'No code should be generated for this.' end if end subroutine f > f90 -O2 -S f.f90 > cat f.s .file "f.f90" .version "02.10" .ident "CFT90 frontend" .data // // Absoft Code Generator Version 2.1
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.