//[Do Not Disturb] Statements


#1

It's difficult to search the forum for information regarding the //[XYZ] statement. Because it is ubiquitous, virtually every post with some example code is returned in the search results. My question is simple. Are the ones in the Introjucer app the only ones allowed or can I add additional ones to prevent the app from deleting a code block? In other words, if I write:

//[Please don't delete this hacky bit]

x = LifesWork();

//[/Please don't delete this hacky bit]

Will it be deleted when I return or re-open Introjucer?

Thanks!


#2

IIRC you can add your own sections if you put them in the template file from which the introjucer is working. The way it works is that the introjucer pulls out the content of these sections from the old file, then writes a completely new file based on its template, and inserts into that new file any content that it found previously. But if there was an old section with a name that doesn't occur in the new file, it can't possibly insert it, as it has no way to know where it would go.


#3

Brilliant! Thank you for the quick response.


#4

Would this work in e.g. the Java Activity class or only for the C++ parts?

 


#5

Where is this template file located and what's its name?


#6

jucer_ComponentTemplate.h/cpp


#7

How do I avoid that introjucer changes the code in a source file at all?

I let introjucer ad a gui component. Now I have made changes to e.g the constructor arguments, but introjucer wants to reset my changes to it's own.

 


#8

If you just remove the introjucer comment block at the end of the file, it'll stop it recognising it as a GUI file.