Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

ignore code lines
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!



Report this thread to moderator Post Follow-up to this message
Old Post
Gertjan Spierenburg
04-22-05 08:59 PM


Re: ignore code lines
"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

Report this thread to moderator Post Follow-up to this message
Old Post
Gareth Owen
04-22-05 08:59 PM


Re: ignore code lines
Gareth 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.

Report this thread to moderator Post Follow-up to this message
Old Post
Duane Bozarth
04-22-05 08:59 PM


Re: ignore code lines
Duane 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
^

Report this thread to moderator Post Follow-up to this message
Old Post
Gareth Owen
04-22-05 08:59 PM


Re: ignore code lines

Gareth 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).


Report this thread to moderator Post Follow-up to this message
Old Post
Gordon Sande
04-23-05 01:57 AM


Re: ignore code lines
Gertjan 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

Report this thread to moderator Post Follow-up to this message
Old Post
Walt Brainerd
04-23-05 01:57 AM


Re: ignore code lines
Gertjan 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

Report this thread to moderator Post Follow-up to this message
Old Post
E. Robert Tisdale
04-23-05 01:57 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Fortran archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 07:27 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.