hi,
is there a Fivewin Function like Xbase++ WorkSpaceList()
i want to know which DBF are open and ALIAS() in a Thread
aGetWorkAreas() //--> Array of Alias names.
for n := 1 to 255
if !Empty( cAlias := Alias( n ) )
AAdd( aAreas, { n, cAlias, (n)->(DBINFO(DBI_FULLPATH))} ) // more information we want
endif
next
SETKEY( VK_F12, { | nKey | DBFTONEN() } ) // ?? Quick way of showing me the open dbf's etc.
FUNCTION dbftonen() // ?? This is showing me in debug mode what file are open
LOCAL n, j, nTarget
LOCAL cErrorlog := ""
cErrorLog += CRLF + "DataBases in use" + CRLF + "================" + CRLF
FOR n = 1 TO 255
IF ! Empty( Alias( n ) )
cErrorLog += CRLF + Str( n, 3 ) + ": " + If( Select() == n, "=> ", " " ) + ;
( Alias( n ) )->( dbInfo( DBI_FULLPATH ) ) + Space( 2 ) + "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() ) ) + Transform( ( Alias( n ) )->( ordKeyCount() ), "9999999" ) + CRLF + CRLF
IF ( Alias( n ) )->( rddName() ) != "ARRAYRDD"
cErrorLog += " Indexes in use " + Space( 23 ) + "TagName" + CRLF + CRLF
FOR j = 1 TO 25
IF ! Empty( ( Alias( n ) )->( IndexKey( j ) ) )
cErrorLog += Space( 8 ) + ;
If( ( Alias( n ) )->( IndexOrd() ) == j, "=> ", " " ) + ;
PadR( ( Alias( n ) )->( IndexKey( j ) ), 35 ) + ;
( Alias( n ) )->( ordName( j ) ) + ;
CRLF
ENDIF
NEXT
cErrorLog += CRLF + " Alias Name : "+ Alias(n) + CRLF + CRLF
cErrorLog += CRLF + " Filters set : " + (alias(n))->(dbfilter())+ CRLF + CRLF
cErrorLog += CRLF + " Relations in use" + CRLF + CRLF
FOR j = 1 TO 8
IF ! Empty( ( nTarget := ( Alias( n ) )->( dbRSelect( j ) ) ) )
cErrorLog += Space( 3 ) + Str( j ) + ": " + ;
"TO " + ( Alias( n ) )->( dbRelation( j ) ) + ;
" INTO " + Alias( nTarget ) + CRLF
// uValue = ( Alias( n ) )->( DbRelation( j ) )
// cErrorLog += cValToChar( ordsetfocus( uValue ) ) + CRLF
ENDIF
NEXT
ENDIF
ENDIF
NEXT
//FW_memoEdit(cErrorlog)
FW_MemoEdit( cErrorlog, "Geopende Databases", 10, 60, 60, 150 )
RETURN NIL
FUNCTION dbftonen() // ?? This is showing me in debug mode what file are open
LOCAL n, j, nTarget, cErrorlog := "", cText, oPrn, oFont
LOCAL lPdfImp := .F. // Genera o no el *.PDF
LOCAL nRow, nCol
cErrorLog += CRLF + "DataBases in use" + CRLF + "================" + CRLF
FOR n = 1 TO 255
IF .NOT. Empty( Alias( n ) )
cErrorLog += CRLF + Str( n, 3 ) + ": " + If( Select() == n, "=> ", " " ) + ;
( Alias( n ) )->( dbInfo( DBI_FULLPATH ) ) + Space( 2 ) + "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() ) ) + Transform( ( Alias( n ) )->( ordKeyCount() ), "9999999" ) + CRLF + CRLF
IF ( Alias( n ) )->( rddName() ) != "ARRAYRDD"
cErrorLog += " Indexes in use " + Space( 23 ) + "TagName" + CRLF + CRLF
FOR j = 1 TO 25
IF ! Empty( ( Alias( n ) )->( IndexKey( j ) ) )
cErrorLog += Space( 8 ) + ;
If( ( Alias( n ) )->( IndexOrd() ) == j, "=> ", " " ) + ;
PadR( ( Alias( n ) )->( IndexKey( j ) ), 35 ) + ;
( Alias( n ) )->( ordName( j ) ) + ;
CRLF
ENDIF
NEXT
cErrorLog += CRLF + " Alias Name : "+ Alias(n) + CRLF + CRLF
cErrorLog += CRLF + " Filters set : " + (alias(n))->(dbfilter())+ CRLF + CRLF
cErrorLog += CRLF + " Relations in use" + CRLF + CRLF
FOR j = 1 TO 8
IF .NOT. Empty( ( nTarget := ( Alias( n ) )->( dbRSelect( j ) ) ) )
cErrorLog += Space( 3 ) + Str( j ) + ": " + ;
"TO " + ( Alias( n ) )->( dbRelation( j ) ) + ;
" INTO " + Alias( nTarget ) + CRLF
ENDIF
NEXT
ENDIF
ENDIF
NEXT
// FW_memoEdit(cErrorlog)
// FW_MemoEdit( cErrorlog, "Geopende Databases", 10, 60, 60, 150 ) // Holandes
// // Lista de bancos de dados abertos
// FW_MemoEdit( cErrorlog, "Lista de Bancos de Dados Abertos", 00, 50, 45, 120 ) // Portugues
IF FILE( "MARC.TXT" )
FERASE( "MARC.TXT" )
ENDIF
// TEXT
MemoWrit( "MARC.TXT", cErrorlog )
cText := MEMOREAD( ".\MARC.TXT" )
// LOGO
nRow := 10
nCol := 600
// Idea orginal by Marc Venken - Belgium
PRINT oPrn NAME "ERRSYSW: OPEN DATABASES IN THE SYSTEM" PREVIEW MODAL
DEFINE FONT oFont NAME "COURIER NEW" SIZE 0, -10 OF oPrn
oPrn:SetPage(9) //-> A4 //9
oPrn:SetPortrait()
WHILE .NOT. EMPTY( cText )
SYSREFRESH()
PAGE
IF FILE( "LOGO.PNG" )
@ nRow, nCol PRINT TO oPrn IMAGE "LOGO.PNG" SIZE 600, 600 LASTROW nRow
ENDIF
@ 1, 1 PRINT TO oPrn TEXT @cText SIZE 7, 10 INCHES FONT oFont
ENDPAGE
ENDDO
IF lPdfImp
oPrn:lMeta = .F. // .T. -> Defecto - .F. Genera el PDF.
ENDIF
ENDPRINT
IF lPdfImp
FWSavePreviewToPDF( oPrn, "MARC.pdf", .F. )
ENDIF
RELEASE FONT oFont
RETURN NIL // Marc Venken
// FIN / END - kapiabafwh@gmail.com
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 92 guests