.bat file to help compile easier - dmd/build

Bill Baxter wbaxter at gmail.com
Fri Jan 2 13:37:09 PST 2009


On Sat, Jan 3, 2009 at 6:35 AM, Bill Baxter <wbaxter at gmail.com> wrote:
> On Sat, Jan 3, 2009 at 4:17 AM, Michael P. <baseball.mjp at gmail.com> wrote:
>> Okay, so right now, I'm making a small game(Mario) using DAllegro. I use build, and every time, I have to type this in to compile my progress:
>>
>> build mario alleg.lib
>>
>> Now, I know it's not a lot of typing. But considering I type mario wrong every so often, and I generally want to execute it after, assuming there is not compiler errors, it takes time.
>> In a .bat file right now, I have this:
>>
>> build mario alleg.lib
>> mario
>>
>> But, mario will execute even if there are errors found by dmd.
>> Is there anything that I can use to see if errors were found, and if there isn't, execute it, and if there is, don't execute it?
>> DMD1.036, Windows XP, Build/Bud 3.04
>
> build mario alleg.lib && mario
>
> Stops after the build if build returns a nonzero exit code.   That bit
> of the DOS shell is more or less just like a Unix shell.


Also, with that one-liner you can just use the up arrow instead of
typing it again or going to the trouble of putting it in a .bat file.

--bb


More information about the Digitalmars-d-learn mailing list