FTEQCC set ERRORLEVEL

Discuss programming in the QuakeC language.
Post Reply
Baker
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

FTEQCC set ERRORLEVEL

Post by Baker »

It doesn't look like if a compile failed with errors that fteqcc sets the ERRORLEVEL flag.

You know, the return anything except 0 upon exit (" exit (1) or exit (errorcode)").

1) Is there a way to do this and I just don't know
2) Does it already do this and I am doing something wrong

The idea is I have a simple batch file that compiles a source. If compiles ok, runs engine with gamedir params.

If compile failed, does a "pause" and I look to see what issue is and does not run engine.

Anyway, if it doesn't have this feature, an idea for the future. If does have feature, please say "Baker you are screwing it up!"
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Re: FTEQCC set ERRORLEVEL

Post by Spike »

you're restarting/quitting the engine each and every time. its faster to just use the restart command.
if you're using the gui version, you can set it up to debug, with the compile button automatically restarting the current map for you on success. be warned that this requires some qcc<->engine interaction so it only works with fteqw right now (the two processes are connected via stdin/stdout).
(if fteqccgui can load the scintilla dll, its actually quite usable, surprisingly enough)

one down side of either running the engine or displaying the results is when it comes to warnings. certain QC warnings should be considered fatal, and are only mere warnings because it breaks id's vanilla qc. hiding output if it produced something can be counter productive (fteqccgui changes half the screen to yellow on warnings to help draw focus to messy code).


aaanyway, regarding your actual issue...
I just had a look at the code, it does look like it returns different values depending on whether it produced something.
/me tests
yup, seems to work.

Code: Select all

if errorlevel 1 echo failed
if not errorlevel 1 echo success
remember that testing for errorlevel 0 directly will be true for 0, 1, 2, etc. so test for 1 and negate it. voila. works. blame microsoft.
if it didn't work, I'm sure someone would have complained sooner...
Baker
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Re: FTEQCC set ERRORLEVEL

Post by Baker »

Spike wrote: remember that testing for errorlevel 0 directly will be true for 0, 1, 2, etc. so test for 1 and negate it. voila. works. blame microsoft.
Interesting. That is my issue then.
if it didn't work, I'm sure someone would have complained sooner...
That is what I thought, It isn't like fteqcc doesn't get tons of usage.

Thanks for the information!
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
Post Reply