Excluding Library Code - Printable Version +- QB64 Phoenix Edition (https://staging.qb64phoenix.com) +-- Forum: Official Links (https://staging.qb64phoenix.com/forumdisplay.php?fid=16) +--- Forum: Learning Resources and Archives (https://staging.qb64phoenix.com/forumdisplay.php?fid=13) +--- Thread: Excluding Library Code (/showthread.php?tid=174) |
Excluding Library Code - SMcNeill - 04-25-2022 If you guys are like me, and code everything into library snippets to reuse it over and over, you probably end up finding that some of your essential code ends up going into multiple libraries and then tossing errors when you make use of those libraries together. Here's a solution which works in this case: Code: (Select All) $IF EXT = UNDEFINED THEN ExtendedTimer is something which I use in a lot of code, and as such, it gets included into a lot of libraries. By coding it like this, QB64 only includes it in my programs once -- no matter how many libraries it's contained within -- and doesn't toss me "Name already in use" errors and whatnot." It's a simple enough little habit to get into using with our library code, and it'll prevent the issues with duplicate copies being in multiple libraries. |