Estou desenvolvendo utilitários muito doidos.
Na imagem o antes e o depois.
14.000 linhas de erro, reduzidas a 3.500 linhas, automaticamente.
E isso nem está contando a declaração de variáveis MEMVAR, senão a diferença seria maior ainda.
Agora olhar as que sobraram pra ver o que dá pra fazer.
Corrigindo aplicativo antigo
Moderador: Moderadores
- JoséQuintas
- Administrador

- Mensagens: 20267
- Registrado em: 26 Fev 2007 11:59
- Localização: São Paulo-SP
Corrigindo aplicativo antigo
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
- JoséQuintas
- Administrador

- Mensagens: 20267
- Registrado em: 26 Fev 2007 11:59
- Localização: São Paulo-SP
Re: Corrigindo aplicativo antigo
De 3,500 pra 2.300
Capturei os erros de "procedure returns value", e fiz a correção.
Código: Selecionar todos
PROCEDURE Main
LOCAL cTxt, aList, cLine, cFile, aPrgList := {}, nPos, aItem
SetMode(33,100)
SetMode("W/B")
CLS
cTxt := MemoRead( "errorlist.txt" )
aList := hb_RegExSplit( hb_Eol(), cTxt )
FOR EACH cLine IN aList
IF "procedure returns value" $ Lower( cLine )
cFile := Substr( cLine, 1, At( ":", cLine ) - 1 )
cLine := Substr( cLine, At( ":", cLine ) + 1 )
cLine := Val( Substr( cLine, 1, At( ":", cLine ) - 1 ) )
nPos := hb_AScan( aPrgList, { | e | e[1] == cFile } )
IF nPos == 0
AAdd( aPrgList, { cFile, {} } )
nPos := Len( aPrgList )
ENDIF
AAdd( aPrgList[ nPos ][ 2 ], cLine )
ENDIF
NEXT
hb_MemoWrit( "test.txt", hb_jsonEncode( aPrgList ) )
FOR EACH aItem IN aPrgList
IF File( aItem[1] )
? aItem[1]
RemoveReturn( aItem[1], aItem[2] )
ENDIF
NEXT
Inkey(0)
RETURN
FUNCTION RemoveReturn( cFile, acLine )
LOCAL cTxt, aList, cItem, nLine
cTxt := MemoRead( cFile )
aList := hb_RegExSplit( hb_Eol(), cTxt )
FOR EACH nLine IN acLine
IF nLine < Len( aList )
IF Right( Upper( Trim( aList[ nLine ] ) ), 10 ) == "RETURN .T."
aList[ nLine ] := Trim( aList[ nLine ] )
aList[ nLine ] := Substr( aList[ nLine ], 1, Len( aList[ nLine ] ) - 3 )
ENDIF
ENDIF
NEXT
cTxt := ""
FOR EACH cItem IN aList
cTxt += cItem + hb_Eol()
NEXT
hb_MemoWrit( cFile, cTxt )
RETURN Nil
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
- JoséQuintas
- Administrador

- Mensagens: 20267
- Registrado em: 26 Fev 2007 11:59
- Localização: São Paulo-SP
Re: Corrigindo aplicativo antigo
Melhorou, dos 13.000 do início do post, restam 200.
A grande maioria resolvida por utilitário em harbour, além de outras alterações.
Isso de fonte pra consertar fonte... é meio doido, mas tá funcionando.
A grande maioria resolvida por utilitário em harbour, além de outras alterações.
Isso de fonte pra consertar fonte... é meio doido, mas tá funcionando.
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
- JoséQuintas
- Administrador

- Mensagens: 20267
- Registrado em: 26 Fev 2007 11:59
- Localização: São Paulo-SP
Re: Corrigindo aplicativo antigo
Um alerta importante:
Essas rotinas são específicas, direcionadas a estes fontes.
Só devem ser usadas por quem trabalha usando GIT, assim tem controle total pra anular alterações inadequadas.
Dependendo dos fontes, podem estragar ao invés de consertar.
Essas rotinas são específicas, direcionadas a estes fontes.
Só devem ser usadas por quem trabalha usando GIT, assim tem controle total pra anular alterações inadequadas.
Dependendo dos fontes, podem estragar ao invés de consertar.
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/