Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

BTM file closes TCC

Jun
772
6
If I run the following btm file in a TCC window, the window closes after the error message is displayed. You don't need the G file. The point is it doesn't exist.
Code:
*on errormsg cancel
*setlocal
*unalias *
echo on
set G=C:\TT\RATINGSCENTRAL\CODE\COMMON\SERVER\SERVEROUTCOMEDATABASE.PAS
iff %@fileage[%G] == 1 then
   echo Oops
endiff

TCC 29.00.17 x64 Windows 10 [Version 10.0.19045.2846]
 
You need to check for the existence of the file first;
Code:
*on errormsg cancel
*setlocal
*unalias *
echo on
set G=R:\SERVEROUTCOMEDATABASE.PAS
iff exist %G then
  iff %@fileage[%G] == 1 then
    echo Oops
  endif
endif

Joe
 
Taking the original code from Post #1,
I have added;
Code:
echo %@fileage[%G]
thus;
Code:
*on errormsg cancel
*setlocal
*unalias *
echo on
set G=C:\TT\RATINGSCENTRAL\CODE\COMMON\SERVER\SERVEROUTCOMEDATABASE.PAS
echo %@fileage[%G]
iff %@fileage[%G] eq 1 then
   echo Oops
endif
...and it works,
that is,
TCC does not close,
and the error is generated.

Joe
 
It would seem that TCC has a problem with the line;
Code:
iff %@fileage[%G] eq 1 then
...which maybe @rconn can explain.

It catches the error on the added line;
Code:
echo %@fileage[%G]
...which is now before the if.

Joe
 
It seems to have something to do with ON ERROR/ON ERRORMSG and an error occurring during the evaluation of IFF's (or IF's) conditional expression. This BTM does it too.

Code:
on error quit
if %@floor[] == 1 echo Oops
 
I get local crash dumps (got several today messing with this). When I run the dump file through WinDbg I see this is a "Fast Fail" (kill this app ASAP) exception. The analysis of the dump file contained this.

Code:
EXCEPTION_CODE: (NTSTATUS) 0xc0000409 - The system detected an overrun of a stack-based buffer in this application. This overrun could potentially allow a malicious user to gain control of this application.

Microsoft learn has a mildly interesting little video on this exception; find it here.
 

Similar threads

Back
Top