errorsysw.prg
Posted: Tue Jan 29, 2019 11:43 pm
When I open files ( tDatabase via tData ) I assign a default alias. Of course, we open the file using the filename. The default alias ( calculated ) allows us to open the same file different times without a problem.
When working with errorsysw, we have the following code to list dbf files:
Because the default ( generated ) Alias is random, it does not help me identify the involved dbf on the error log. We not only pass the cAlias but we also pass cFile ( the file name that is actually opened ). I would like to include the actual file name, but can't seem to find a way to pull it out in this situation.
Note the commented line in the code. That forces the error program to quit without displaying anything.
Any suggestions will be greatly appreciated.
When working with errorsysw, we have the following code to list dbf files:
Code: Select all | Expand
cErrorLog += CRLF + "DataBases in use" + CRLF + "================" + CRLF
for n = 1 to 255
if ! Empty( Alias( n ) )
// cErrorLog += (Alias(n))->( cFile ) + CRLF
cErrorLog += CRLF + Str( n, 3 ) + ": " + If( Select() == n,"=> ", " " ) + ;
PadR( Alias( n ), 15 ) + Space( 20 ) + "RddName: " + ;
( Alias( n ) )->( RddName() ) + CRLF
cErrorLog += " ==============================" + CRLF
cErrorLog += " RecNo RecCount BOF EOF" + CRLF
cErrorLog += " " + Transform( ( Alias( n ) )->( RecNo() ), "9999999" ) + ;
" " + Transform( ( Alias( n ) )->( RecCount() ), "9999999" ) + ;
" " + cValToChar( ( Alias( n ) )->( BoF() ) ) + ;
" " + cValToChar( ( Alias( n ) )->( EoF() ) ) + CRLF + CRLF
Because the default ( generated ) Alias is random, it does not help me identify the involved dbf on the error log. We not only pass the cAlias but we also pass cFile ( the file name that is actually opened ). I would like to include the actual file name, but can't seem to find a way to pull it out in this situation.
Note the commented line in the code. That forces the error program to quit without displaying anything.
Any suggestions will be greatly appreciated.