Searching \ for '[PIC]: Comments in MPLAB' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/languages.htm?key=mplab
Search entire site for: 'Comments in MPLAB'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: Comments in MPLAB'
2002\06\19@132827 by Pic Dude

flavicon
face
[PIC seems to be the best tag for this]...

Is there any way to comment out a block of code in MPLAB, w/o
dropping a semi-colon on every single line?  Could not find an
answer to this in the MPLAB users' guide.

Cheers,
-Neil.

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email spam_OUTlistservTakeThisOuTspammitvma.mit.edu with SET PICList DIGEST in the body


2002\06\19@134652 by uter van ooijen & floortje hanneman

picon face
> Is there any way to comment out a block of code in MPLAB, w/o
> dropping a semi-colon on every single line?  Could not find an
> answer to this in the MPLAB users' guide.

make the whole thing into a macro definition (defining a name that is never
used)?

Wouter van Ooijen
--
Van Ooijen Technische Informatica: http://www.voti.nl
Jal compiler, Wisp programmer, WLoader bootloader, PICs kopen

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email .....listservKILLspamspam@spam@mitvma.mit.edu with SET PICList DIGEST in the body


2002\06\19@154008 by Bob Barr

flavicon
face
On Wed, 19 Jun 2002 12:24:54 -0500, Pic Dude wrote:

>[PIC seems to be the best tag for this]...
>
>Is there any way to comment out a block of code in MPLAB, w/o
>dropping a semi-colon on every single line?  Could not find an
>answer to this in the MPLAB users' guide.
>

There may be other ways to do this but my practice is to use an
if/endif pair.

Immediately before the code I want to eliminate I insert the line:

 if  0

When I want to end the 'commenting', I insert the line:

 endif

Works like a champ.


Regards, Bob

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listservspamKILLspammitvma.mit.edu with SET PICList DIGEST in the body


2002\06\19@163747 by Olin Lathrop

face picon face
> Is there any way to comment out a block of code in MPLAB, w/o
> dropping a semi-colon on every single line?  Could not find an
> answer to this in the MPLAB users' guide.

 if 0
;
;   Commented out code goes here
;
   endif


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email .....listservKILLspamspam.....mitvma.mit.edu with SET PICList DIGEST in the body


2002\06\19@185531 by Harold M Hallikainen

picon face
I do this with conditional assembly. For example, to comment out your
original message, I'd do

 if 0

On Wed, 19 Jun 2002 12:24:54 -0500 Pic Dude <EraseMEpicdudespam_OUTspamTakeThisOuTAVN-TECH.COM>
writes:
{Quote hidden}

 endif


Harold


FCC Rules Online at http://hallikainen.com/FccRules
Lighting control for theatre and television at http://www.dovesystems.com

Reach broadcasters, engineers, manufacturers, compliance labs, and
attorneys.
Advertise at http://www.hallikainen.com/FccRules/ .


________________________________________________________________
GET INTERNET ACCESS FROM JUNO!
Juno offers FREE or PREMIUM Internet access for less!
Join Juno today!  For your FREE software, visit:
dl.http://www.juno.com/get/web/.

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email @spam@listservKILLspamspammitvma.mit.edu with SET PICList DIGEST in the body


2002\06\19@231057 by Bob Ammerman

picon face
   IF 0
   code to be ignored
   ENDIF

Bob Ammerman
RAm Systems

----- Original Message -----
From: "wouter van ooijen & floortje hanneman" <KILLspamwfKILLspamspamXS4ALL.NL>
To: <RemoveMEPICLISTTakeThisOuTspamMITVMA.MIT.EDU>
Sent: Wednesday, June 19, 2002 1:31 AM
Subject: Re: [PIC]: Comments in MPLAB


> > Is there any way to comment out a block of code in MPLAB, w/o
> > dropping a semi-colon on every single line?  Could not find an
> > answer to this in the MPLAB users' guide.
>
> make the whole thing into a macro definition (defining a name that is
never
{Quote hidden}

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email TakeThisOuTlistservEraseMEspamspam_OUTmitvma.mit.edu with SET PICList DIGEST in the body


2002\06\20@082758 by Dwayne Reid

flavicon
face
At 12:24 PM 6/19/02 -0500, Pic Dude wrote:
>[PIC seems to be the best tag for this]...
>
>Is there any way to comment out a block of code in MPLAB, w/o
>dropping a semi-colon on every single line?  Could not find an
>answer to this in the MPLAB users' guide.

I use "ifdef" or "ifndef" with a label that I *know* is undefined (not used
anywhere else) and describes the block of code you are commenting out:

;  #define SomeLabelThatDescribesThisBlock  ;un-comment this line to enable
the block of code
 ifdef SomeLabelThatDescribesThisBlock

   code goes here
    ...
   more code
 endif

You now have 2 choices: remove the ifdef and endif around the block or
simply remove the semi-colon at the front of the #define line.

I'm sure that there are other techniques but this is what I use.

dwayne

--
Dwayne Reid   <RemoveMEdwaynerspamTakeThisOuTplanet.eon.net>
Trinity Electronics Systems Ltd    Edmonton, AB, CANADA
(780) 489-3199 voice          (780) 487-6397 fax

Celebrating 18 years of Engineering Innovation (1984 - 2002)
 .-.   .-.   .-.   .-.   .-.   .-.   .-.   .-.   .-.   .-
    `-'   `-'   `-'   `-'   `-'   `-'   `-'   `-'   `-'
Do NOT send unsolicited commercial email to this email address.
This message neither grants consent to receive unsolicited
commercial email nor is intended to solicit commercial email.

--
http://www.piclist.com hint: To leave the PICList
piclist-unsubscribe-requestEraseMEspam.....mitvma.mit.edu


2002\06\21@072538 by Roman Black

flavicon
face
Something nobody mentioned yet is just to put
a goto block_end (etc) before the code block you
want to disable. This has the added advantage
of still assembling ALL the code, so code and
tables that cross code pages etc will still remain
in the same positions in memory, something that
really could catch a beginning programmer who
is mainly disabling large blocks of their code
to test things.
-Roman


Harold M Hallikainen wrote:
{Quote hidden}

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2002\06\21@083925 by Olin Lathrop

face picon face
> Something nobody mentioned yet is just to put
> a goto block_end (etc) before the code block you
> want to disable. This has the added advantage
> of still assembling ALL the code, so code and
> tables that cross code pages etc will still remain
> in the same positions in memory,

Except for the added GOTO.

> something that
> really could catch a beginning programmer who
> is mainly disabling large blocks of their code
> to test things.


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2002\06\21@084749 by Roman Black

flavicon
face
Olin Lathrop wrote:
>
> > Something nobody mentioned yet is just to put
> > a goto block_end (etc) before the code block you
> > want to disable. This has the added advantage
> > of still assembling ALL the code, so code and
> > tables that cross code pages etc will still remain
> > in the same positions in memory,
>
> Except for the added GOTO.


Well when using this quick-and-nasty technique
I actually comment out the first inst of the block
and use the goto instead. But i'm sure you knew that
already. :o)
-Roman

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2002\06\21@105621 by Pic Dude

flavicon
face
This was my standard way of bypassing code sections when
testing, but I asked about the comments specifically
since I needed the code to not be assembled.

Thanks,
-Neil.



{Original Message removed}

2002\06\21@120635 by Dwayne Reid

flavicon
face
At 12:24 PM 6/19/02 -0500, Pic Dude wrote:
>[PIC seems to be the best tag for this]...
>
>Is there any way to comment out a block of code in MPLAB, w/o
>dropping a semi-colon on every single line?  Could not find an
>answer to this in the MPLAB users' guide.

I use "ifdef" or "ifndef" with a label that I *know* is undefined (not used
anywhere else) and describes the block of code you are commenting out:

;  #define SomeLabelThatDescribesThisBlock  ;un-comment this line to enable
the block of code
 ifdef SomeLabelThatDescribesThisBlock

   code goes here
    ...
   more code
 endif

You now have 2 choices: remove the ifdef and endif around the block or
simply remove the semi-colon at the front of the #define line.

I'm sure that there are other techniques but this is what I use.

dwayne

--
Dwayne Reid   <RemoveMEdwaynerEraseMEspamEraseMEplanet.eon.net>
Trinity Electronics Systems Ltd    Edmonton, AB, CANADA
(780) 489-3199 voice          (780) 487-6397 fax

Celebrating 18 years of Engineering Innovation (1984 - 2002)
 .-.   .-.   .-.   .-.   .-.   .-.   .-.   .-.   .-.   .-
    `-'   `-'   `-'   `-'   `-'   `-'   `-'   `-'   `-'
Do NOT send unsolicited commercial email to this email address.
This message neither grants consent to receive unsolicited
commercial email nor is intended to solicit commercial email.

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


More... (looser matching)
- Last day of these posts
- In 2002 , 2003 only
- Today
- New search...