CompilerRun() command

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

CompilerRun() command

Post by PB »

Okay, you now how I hate installing tools in the make the IDE do
stuff before compilation? :) How about a command that when the
compiler reaches it, it executes the commandline specified and waits
until the execution completes, and then continues compiling?

Basically, it would let me do this:

Code: Select all

CompilerRun("C:\MyAppToCreateIncludesFromIcons.exe")
; Compiler continues when the above exe is done.
This would bring powerful and convenient compilation abilities to us.
Such as: it would allow the possibility to download the latest version
of something from the internet for inclusion as an embedded binary,
or to includefile something that the run exe just generated, and so on.

Let's say, for whatever reason, that I wanted my app to include a fresh
and current directory listing of C: in my source. I could do it like this:

Code: Select all

CompilerRun("dir c: >c:\list.txt") ; Creates the list!
IncludeFile "c:\list.txt" ; And now includes it! Cool!
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Re: CompilerRun() command

Post by Danilo »

Very good idea and very powerful :!:
Post Reply