Jump to content
Sign in to follow this  
H2SO4_on_PIC

More preprocessor directives

Recommended Posts

Hello, first sorry for my english

I have purchased SourceBoost and i am happy using it.

 

When i compile my projects something is usefull some extra preprocessor directives for send messages at the output windows, for check my condicional compilations are success.

 

examples:

// directive '#message ...'

#ifdef SCL

#messaje "compilated for..."   <--- Message in the output windows

...

#endif

 

// directive '#error ...'

#ifndef

#error "Definitions are not valid for this conditions" <--- Message in the output windows and the compiler stop

#endif

 

For me that may be usefull for checking my source code

 

thanx:

David Valdez

:D

Share this post


Link to post
Share on other sites
Guest Joe

Yes, i could use this feature too.

 

At the moment, i use a spare output to flash an LED for debugging.

Share this post


Link to post
Share on other sites
Guest Joe

These features are built into mpasm (the assembler), so you can use error messages, general messages etc..

 

See MPASM help files:

 

start > programs > mplab > mpasm help

 

>> contents >> Using MPASM Assembler >> Directive Usage >> Directive by Type >> [scroll down page to LISTING]

 

Take a look at "ERROR" and "MMESG"

 

Useage:

 

In your 'C' source:

 

asm messg "this is a message";
asm error "this is an error";

 

Try it... The messages appear in the Output window.

 

Assembly will stop as soon as it hits the error directive.

Share this post


Link to post
Share on other sites
Guest Joe

:P forum keeps logging me out!

 

The message doesn't do as i described, it actually adds the message to the LST file, still usefull i guess?

Share this post


Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...