user19601: I would like to be able to exclude from the auto-including process of the current project (without renaming the extension or delete it) a sketch with pde or ino extension that is used in certain circumstances only.
How can I do this?
I currently use Visual Micro to manage projects on Arduino.

user3917: One possible approach is to guard the body of that sketch with an #ifdef ... #endif pair, and use Visual Micro's  “Project Properties” to define (or not) a preprocessor symbol.  [If the .ino or .pde in question is used as a #include file, you would instead guard all the #include instances.]
Refer to the “Project Defines” page at visualmicro.com for how to define a preprocessor symbol and its value. [Via: Tools > Options > Visual Micro > Compiler > Show Build Properties]  Also see  How do I add additional compiler switches in Visual Studio.
If necessary, you can use other tests besides #ifdef to control compilation.  The first link above shows the following example.
#if USBPORT > 3
....your code here....
#endif


19601: <p>I would like to be able to exclude from the auto-including process of the current project (without renaming the extension or delete it) a sketch with <code>pde</code> or <code>ino</code> extension that is used in certain circumstances only.</p>

<p>How can I do this?</p>

<p>I currently use Visual Micro to manage projects on Arduino.</p>
 3917: <p>One possible approach is to guard the body of that sketch with an <code>#ifdef ... #endif</code> pair, and use Visual Micro's  “Project Properties” to define (or not) a preprocessor symbol.  [If the .ino or .pde in question is used as a <code>#include</code> file, you would instead guard all the <code>#include</code> instances.]</p>

<p>Refer to the <a href="http://www.visualmicro.com/page/User-Guide.aspx?doc=Project-Defines.html" rel="nofollow noreferrer">“Project Defines”</a> page at visualmicro.com for how to define a preprocessor symbol and its value. [Via: Tools > Options > Visual Micro > Compiler > Show Build Properties]  Also see  <a href="https://arduino.stackexchange.com/q/13105">How do I add additional compiler switches in Visual Studio</a>.</p>

<p>If necessary, you can use other tests besides <code>#ifdef</code> to control compilation.  The first link above shows the following example.</p>

<pre><code>#if USBPORT &gt; 3
....your code here....
#endif
</code></pre>
