In the build options dialog you can set a symbol that tells the compiler wh= ich=20 configuration to build for. Use #ifdef SYMBOL or #if SYMBOL=3D=3Dvalue prep= rocessor=20 directives in your source to conditionally compile for your different=20 configurations. Change the symbol depending on the build you are currently= =20 working on. If you can select DEBUG or RELEASE build option (depending on the language= =20 tool) you can also use the __DEBUG symbol but that doesn't distinguish betw= een=20 different debugers or the simulator. Another option is to set the build configuration symbol in an include file = that=20 is included by all source files which have different codes for different bu= ild=20 configurations. Yet another option is to switch to MPLAB X where multiple configurations is= a=20 native function and easily handled. The source editor also gives visual=20 feedback of which codeblocks within #if.. #else #endif sections are actuall= y=20 used for the selected configuration. /Ruben > I can't quite tell, but I don't think so. I neglected to mention that I = am > using MPLAB 8. The other thing is, that I need to be able to distinguish > between a hardware debugger that is an ICD or RealICE, and the software > debugger "SIM". Mostly, I have to use the ICD and real hardware to test > things, because the SIM has so many problems. But it would be nice to be > able to select SIM as the debugger, and have the compiler automatically > compile the right (workaround) code. >=20 > But, thanks for the reply. It looks like, in the future, MPLAB X may be > able to do this. >=20 >=20 > On Mon, Apr 22, 2013 at 8:16 PM, Tamas Rudnai wro= te: >=20 > > Is this what you are looking for? > > > > http://microchip.wikidot.com/mplab:debug-macro > > > > Tamas > > > > > > On 22 April 2013 17:10, Barry Gershenfeld wrote: > > > > > I'm looking for a macro to know when MPLAB-SIM has been selected... > > > --=20 > http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Ruben J=F6nsson AB Liros Electronic Box 9124 200 39 Malm=F6 Sweden www.liros.se Tel +46 40142078 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .