I have been scanning the forum and elsewhere looking for an answer to this question, but thus far no joy.
Is there a simple way (i.e., without commenting out every line in every method inside an object) to get the compiler to ignore certain items/objects? It would be great if I could designate a folder such that everything in it is skipped. Or if there is a flag I can set for individual objects that accomplishes the same thing.
Either option would be especially handy when I am in the midst of cannibalizing pieces of another project, class, example, etc. but don’t want those source pieces to be an active part of the project.
For Classes, Methods, and Modules you can tell the compiler not to include them by target platform:
This is not available for Folders.
Thanks Tim. Maybe someday my dream of a skippable folder will be realized.
Are you talking about part of the code in a method that you would like not to be included (compiled) ?
No. Ideally, I would like to be able to right click on an object, class, etc., choose “Ignore” from the contextual menu and have a red X appear next to it in the items list to indicate that it’s being ignored. Or go through that process with a folder such that anything placed in that folder is ignored.
There are many other possible approaches, of course, that’s just the one I’ve had in mind. I would like for it to be easy to flag items to be ignored and for it to be readily apparent in the IDE that the item is being ignored… something similar to the approach to setting the scope of an item as private, etc.
idealy the compiler should strip away anything that’s not used or referenced anywhere.
I hear you, but my issue often involves fragments of code from various places that are chock full of broken references, etc., which trips up error checking.
can you use a module instead of a folder?
means classes inside of a module, you could set “include in” only once for the module and
things inside would be ignored too.
possibilities to access the class indise of a module
'Var a As New Module1.Class2 'Scope Public
'Var a As New Class2 'Scope Global
That’s an interesting idea Markus. I will fiddle with that a bit.