Go Back   Scooter Forums > Beyond Compare 3 Discussion > Scripting
Register FAQ Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
  #1  
Old 11-Aug-2008, 11:15 AM
turnje turnje is offline
Visitor
 
Join Date: Aug 2007
Posts: 5
Unhappy BC3 Error Handling

I am trying to write a batch file, which will load a session and produce a difference report between to directories.

This batch file, will use an infile and the /silent option

Please can someone just clarify the DOS Error handling for me as I can get an errorlevel "9009" if I have an unknown command in the infile, however when I create a "Fatal Scripting Error: Unable to load base folder" error - the DOS Errorlevel is "0".

The reason I need to confirm the successfull completion is so that I can automate the task using a scheduler tool and want additional actions to be performed based on the completion status.

Any assistance would be greatly appriciated - thanks
Reply With Quote
  #2  
Old 11-Aug-2008, 11:46 AM
Michael Bulgrien Michael Bulgrien is offline
Carpal Tunnel
 
Join Date: Oct 2007
Location: Pennsylvania
Posts: 1,459
Default

You can check the %errorlevel% variable in a batch file (command script):

if %errorlevel%==9009 goto...
__________________
BC build 3.2.00.12469 (beta)
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
Reply With Quote
  #3  
Old 12-Aug-2008, 02:57 AM
turnje turnje is offline
Visitor
 
Join Date: Aug 2007
Posts: 5
Default

Thanks Michael, but what about the "Fatal Scripting Error: Unable to load base folder", as this returns a DOS Errorlevel of 0, however the script has failed.

The only other way I can think of is to include a script, which searches the log file for "Fatal Scripting Error" and returns a Errorlevel of 1, however this seams a bit long winded.

Does BComp.exe not return DOS error codes for fatal error??
Reply With Quote
  #4  
Old 12-Aug-2008, 09:14 AM
Michael Bulgrien Michael Bulgrien is offline
Carpal Tunnel
 
Join Date: Oct 2007
Location: Pennsylvania
Posts: 1,459
Default

Sorry, I guess I missed the crux of your question. Scooter will need to address the error level 0 on a "Fatal Scripting Error". According to the help file, the following DOS Error Levels are set on exit:

0 - Success
1 - Binary Match
2 - Rules-Based Match
11 - Binary Difference
12 - Similar
13 - Rules-Based Difference
14 - Conflicts Detected
100 - Unknown error
101 - Conflicts Detected. Merge output not written.

I would think that failure to load a file or folder could generate its own errorlevel or, if nothing else, an errorlevel 100.
__________________
BC build 3.2.00.12469 (beta)
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
Reply With Quote
  #5  
Old 12-Aug-2008, 09:36 AM
Aaron Aaron is offline
Team Scooter
 
Join Date: Oct 2007
Location: Madison, WI
Posts: 2,205
Default

Thanks, Michael. The Error Code section in the Help File actually refers to using the /qc or Quick Compare arguements. We do not set error codes for scripting (neither did BC2).

We're currently working on other projects/issues, but this sounds like a good idea. I'll make a tracker entry for this feature.
__________________
Aaron P Scooter Software
Reply With Quote
  #6  
Old 12-Aug-2008, 09:44 AM
turnje turnje is offline
Visitor
 
Join Date: Aug 2007
Posts: 5
Default

Thanks Aaron / Michael for your help in this matter.
Reply With Quote
  #7  
Old 27-Jan-2009, 06:23 AM
turnje turnje is offline
Visitor
 
Join Date: Aug 2007
Posts: 5
Red face BC3 Error Handling

Hi Aaron

Any news on when DOS batchmode error handling will be added to BC3??

Thanks
Reply With Quote
  #8  
Old 27-Jan-2009, 09:52 AM
Aaron Aaron is offline
Team Scooter
 
Join Date: Oct 2007
Location: Madison, WI
Posts: 2,205
Default

It is currently an open entry. It is something we would like to do in a future release, but is not scheduled development.
__________________
Aaron P Scooter Software
Reply With Quote
  #9  
Old 28-Jan-2009, 12:16 AM
Pete Pete is offline
Fanatic
 
Join Date: Nov 2007
Location: U.S.
Posts: 154
Default

Also, it would be nice if we could get a return code from the command line regardless if we call a script or a normal session.
Reply With Quote
  #10  
Old 02-Feb-2009, 01:19 PM
Craig Craig is offline
Team Scooter
 
Join Date: Oct 2007
Location: Madison, WI
Posts: 1,749
Default

The next release will have this fixed. The scripting engine will now return the following exit codes:

0: Script successful (no fatal errors). May include non-fatal errors (eg, access denied during a copy)
100: Unknown error
105: Unable to load script file
106: Syntax error
107: Unable to load base folder (also includes paths from a FILE-REPORT command)
__________________
Craig P Scooter Software
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -6. The time now is 03:50 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.