Can one put an Include within an Include file?
Can one put an Include within an Include file?
Well no, but really I'm wondering if there is a limitation. Multiple includes with includes within them. Since it all "happens" before compile time, I suppose it doesn't matter?
As far as I know - no, it doesn't matter.
Whatever is in the included file gets put, byte for byte, where the INCLUDE "thisorthatfile.pbp" line is placed so you can have a source file wich includes two other files, which each includes two other files and so on. It's not a good idea to include the SAME file more than once though, if that's a "risk" you need to use conditionals to make sure it's only "compiled in" once even though it's included at several places.
Disclaimer: I haven't done anything like the above.
/Henrik.
The only issue I could see with having lots of include files for standard things, say routines for reading and RTC, writing to an EEPROM, updating an LCD etc is that you wouldn't have much code structure in the main program !
Agreed Scampy, it could become more difficult to debug if there was some "hidden" conflict since it wouldn't be as readable.
Bookmarks