Page 1 of 1

Default IncludeFile when IDE starts

Posted: Tue Jan 30, 2007 8:07 am
by PB
I requested this once before but I can't find it now. :)

I'd like to see an OPTION where a specific IncludeFile could be recognized by
the IDE when it starts. For example, in "Compiler Options" and above the
"Library Subsystem" setting. It would have a name of "Default IncludeFile"
with room for a string for the user to specify a file. Then, when the IDE is
loaded, this file is recognized by the compiler as if the user had included it
manually at the top of his code like this:

Code: Select all

IncludeFile "MyFavoriteProcedures.pb"
The reason for this request is simple: it saves me having to copy-and-paste
my favorite procedures into my new apps, essentially making that file a bit
like a "library" (even though it isn't). I know that any unused procedures will
also be included, but that's my problem to deal with later. :) Sound good?

Posted: Tue Jan 30, 2007 9:51 am
by Derek
Except when you just want to compile a small program and forget to turn the include off.

Posted: Tue Jan 30, 2007 9:55 am
by PB
Hmm, good point... maybe that's why my previous request got deleted?

Anyway, I just realized I can do it myself by making a small read-only source
with the IncludeFile as the first line, and then when I go to save it, it'll prompt
me for a new name... thus doing exactly what I requested here. :) Thanks for
the heads-up, and Fred can safely ignore this request. ;)

Posted: Tue Jan 30, 2007 12:38 pm
by freak
This can also be done with an editor tool.

Register the tool for the triggers "Before Compile/Run" and "Before Create Executable",
as argument use the %COMPILEFILE parameter. This gives you the temporary
file that will be compiled. You can modify this and your modification will be compiled.
(this will not affect the real source file you saved)

The trick is that you have to insert your IncludeFile at the start without adding a newline (ie Includefile "yourfile": <here comes the old first line>),
this way the linenumbers for the debugger do not get messed up, and you will not notice any difference when debugging from the IDE.