From cc9f1d9e24881d7d1228c3eb09cd30cbc6543a7d Mon Sep 17 00:00:00 2001 From: fdbozzo Date: Sat, 28 Jun 2014 00:09:38 +0200 Subject: [PATCH] =?UTF-8?q?Changeset:=20341=20fdbozzo=20-=2027/06/2014=201?= =?UTF-8?q?9:01:21:=20-=20Quitar=20los=20asteriscos=20que=20pudieran=20hab?= =?UTF-8?q?er=20entre=20los=20ENDPROC=20y=20PROCEDURE,=20analizados=20en?= =?UTF-8?q?=20ese=20orden,=20para=20regenerar=20binario=20sin=20errores.?= =?UTF-8?q?=20(Daniel=20S=C3=A1nchez)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- foxbin2prg.prg | 20 +++++++++++++++----- foxbin2prg_de.h | 2 +- foxbin2prg_en.h | 2 +- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/foxbin2prg.prg b/foxbin2prg.prg index a9754df..51d8a1b 100644 --- a/foxbin2prg.prg +++ b/foxbin2prg.prg @@ -90,6 +90,7 @@ * 14/06/2014 FDBOZZO v1.19.24 Arreglo bug vcx/scx: Un campo de tabla llamado "text" que comienza la línea puede confundirse con la estructura TEXT/ENDTEXT y reconocer mal el resto del código * 16/06/2014 FDBOZZO v1.19.25 Mejora: Agregado soporte de configuraciones (CFG) por directorio que, si existen, se usan en lugar del principal (Mario Peschke) * 17/06/2014 FDBOZZO v1.19.25 Mejora: Si durante la generación de binarios o de textos se producen errores, mostrar un mensaje avisando de ello (Pedro Gutiérrez M.) +* 27/06/2014 FDBOZZO v1.19.26 Mejora: Si el campo memo "methods" de los vcx/scx contiene asteriscos fuera de lugar (que no debería), FoxBin2Prg lo procesa igualmente. (Daniel Sánchez) * * *--------------------------------------------------------------------------------------------------- @@ -124,6 +125,7 @@ * 13/06/2014 Mario Peschke REPORTE BUG vcx/scx v1.19.23: Los campos de tabla con nombre "text" a veces provocan corrupción del binario generado (Arreglado en v1.19.24) * 16/06/2014 Mario Peschke MEJORA v1.19.24: Agregado soporte de configuraciones (CFG) por directorio que, si existen, se usan en lugar del CFG principal (Agregado en v1.19.25) * 17/06/2014 Pedro Gutiérrez M. MEJORA v1.19.24: Si durante la generación de binarios o de textos se producen errores, mostrar un mensaje avisando de ello (Agregado en v1.19.25) +* 27/06/2014 Daniel Sánchez MEJORA v1.19.25: Si el campo memo "methods" de los vcx/scx contiene asteriscos fuera de lugar (que no debería), FoxBin2Prg falla. Debería poder procesarlo igual. * * *--------------------------------------------------------------------------------------------------- @@ -346,7 +348,7 @@ LPARAMETERS tc_InputFile, tcType, tcTextName, tlGenText, tcDontShowErrors, tcDeb #DEFINE C_ONLY_SETNAME_AND_GETNAME_RECOGNIZED_LOC "Operación no reconocida. Solo re reconoce SETNAME y GETNAME." #DEFINE C_OUTPUT_FILE_IS_NOT_OVERWRITEN_LOC "Optimización: El archivo de salida [<>] no se sobreescribe por ser igual al generado." #DEFINE C_OUTPUTFILE_NEWER_THAN_INPUTFILE_LOC "Optimización: El archivo de salida [<>] no se regenera por ser más nuevo que el de entrada." - #DEFINE C_PROCEDURE_NOT_CLOSED_ON_LINE_LOC "Procedimiento sin cerrar. La última línea de código debe ser ENDPROC. [<>]" + #DEFINE C_PROCEDURE_NOT_CLOSED_ON_LINE_LOC "Procedimiento sin cerrar. La última línea de código debe ser ENDPROC. [<>, Recno:<>]" #DEFINE C_PROCESSING_LOC "Procesando archivo" #DEFINE C_PROCESS_PROGRESS_LOC "Avance del proceso:" #DEFINE C_PROPERTY_NAME_NOT_RECOGNIZED_LOC "Propiedad [<>] no reconocida." @@ -8524,7 +8526,7 @@ DEFINE CLASS c_conversor_bin_a_prg AS c_conversor_base *-- taCode[1] *-- Bloque de código del método en su posición original TRY - LOCAL lnLineCount, laLine(1), I, lnTextNodes, tcSorted, lnProtectedLine, lcMethod, lnLine_Len, lcLine + LOCAL lnLineCount, laLine(1), I, lnTextNodes, tcSorted, lnProtectedLine, lcMethod, lnLine_Len, lcLine, llProcOpen LOCAL loEx AS EXCEPTION DIMENSION taMethods(1,3) STORE '' TO taMethods, tcSorted, taCode @@ -8542,7 +8544,9 @@ DEFINE CLASS c_conversor_bin_a_prg AS c_conversor_base *-- Delete beginning empty lines before first "PROCEDURE", that is the first not empty line. FOR I = 1 TO lnLineCount - IF NOT EMPTY(laLine(I)) + IF EMPTY(laLine(I)) OR LEFT( LTRIM(laLine(I)),1 ) = '*' + *-- Skip empty and commented lines + ELSE IF I > 1 FOR X = I-1 TO 1 STEP -1 ADEL(laLine, X) @@ -8556,7 +8560,7 @@ DEFINE CLASS c_conversor_bin_a_prg AS c_conversor_base *-- Delete ending empty lines after last "ENDPROC", that is the last not empty line. FOR I = lnLineCount TO 1 STEP -1 - IF EMPTY(laLine(I)) + IF EMPTY(laLine(I)) OR LEFT( LTRIM(laLine(I)),1 ) = '*' ADEL(laLine, I) ELSE IF I < lnLineCount @@ -8608,6 +8612,7 @@ DEFINE CLASS c_conversor_bin_a_prg AS c_conversor_base taMethods(tnMethodCount, 2) = tnMethodCount taMethods(tnMethodCount, 3) = '' taCode(tnMethodCount) = laLine(I) + CR_LF + llProcOpen = .T. CASE lnTextNodes = 0 AND UPPER( LEFT(laLine(I), 17) ) == 'HIDDEN PROCEDURE ' tnMethodCount = tnMethodCount + 1 @@ -8616,6 +8621,7 @@ DEFINE CLASS c_conversor_bin_a_prg AS c_conversor_base taMethods(tnMethodCount, 2) = tnMethodCount taMethods(tnMethodCount, 3) = 'HIDDEN ' taCode(tnMethodCount) = laLine(I) + CR_LF + llProcOpen = .T. CASE lnTextNodes = 0 AND UPPER( LEFT(laLine(I), 20) ) == 'PROTECTED PROCEDURE ' tnMethodCount = tnMethodCount + 1 @@ -8624,6 +8630,7 @@ DEFINE CLASS c_conversor_bin_a_prg AS c_conversor_base taMethods(tnMethodCount, 2) = tnMethodCount taMethods(tnMethodCount, 3) = 'PROTECTED ' taCode(tnMethodCount) = laLine(I) + CR_LF + llProcOpen = .T. CASE lnTextNodes = 0 AND LEFT(laLine(I), 7) == 'ENDPROC' lcLine = UPPER( CHRTRAN( laLine(I) , '&'+CHR(9)+CHR(0), ' ') ) + ' ' @@ -8636,8 +8643,11 @@ DEFINE CLASS c_conversor_bin_a_prg AS c_conversor_base ENDIF taCode(tnMethodCount) = taCode(tnMethodCount) + laLine(I) + CR_LF + llProcOpen = .F. - CASE tnMethodCount = 0 && Skip empty lines before methods begin + CASE tnMethodCount = 0 OR NOT llProcOpen AND LEFT( LTRIM(laLine(I)),1 ) = '*' + *-- Skip empty and commented lines before methods begin + *-- Aquí como condición podría poner: NOT llProcOpen AND LEFT(laLine(I), 7) # 'ENDPROC', pero abarcaría demasiado. OTHERWISE && Method Code taCode(tnMethodCount) = taCode(tnMethodCount) + laLine(I) + CR_LF diff --git a/foxbin2prg_de.h b/foxbin2prg_de.h index c93bd27..ed8845d 100644 --- a/foxbin2prg_de.h +++ b/foxbin2prg_de.h @@ -35,7 +35,7 @@ #DEFINE C_ONLY_SETNAME_AND_GETNAME_RECOGNIZED_LOC "Befehl nicht erkannt. Nur SETNAME und GETNAME erlaubt." #DEFINE C_OUTPUT_FILE_IS_NOT_OVERWRITEN_LOC "Optimierung: Ausgabedatei [<>] wurde nicht überschrieben da sie dieselbe ist wie die neu generierte." #DEFINE C_OUTPUTFILE_NEWER_THAN_INPUTFILE_LOC "Optimierung: Ausgabedatei [<>] wurde nicht erneuert da sie neuer ist als die Ursprungsdatei." -#DEFINE C_PROCEDURE_NOT_CLOSED_ON_LINE_LOC "Procedur nicht geschlossen. Letzte Zeile des Codes muss ENDPROC sein. [<>]" +#DEFINE C_PROCEDURE_NOT_CLOSED_ON_LINE_LOC "Procedur nicht geschlossen. Letzte Zeile des Codes muss ENDPROC sein. [<>, Recno:<>]" #DEFINE C_PROCESSING_LOC "Bearbeite Datei" #DEFINE C_PROCESS_PROGRESS_LOC "Bearbeitungsfortschritt:" #DEFINE C_PROPERTY_NAME_NOT_RECOGNIZED_LOC "Eigenschaft [<>] nicht erkannt." diff --git a/foxbin2prg_en.h b/foxbin2prg_en.h index af823ec..7c5d070 100644 --- a/foxbin2prg_en.h +++ b/foxbin2prg_en.h @@ -35,7 +35,7 @@ #DEFINE C_ONLY_SETNAME_AND_GETNAME_RECOGNIZED_LOC "Operation not recognized. Only SETNAME and GETNAME allowed." #DEFINE C_OUTPUT_FILE_IS_NOT_OVERWRITEN_LOC "Optimization: Output file [<>] was not overwritten because it is the same as was generated." #DEFINE C_OUTPUTFILE_NEWER_THAN_INPUTFILE_LOC "Optimization: Output file [<>] was not regenerated because it is newer than the inputfile." -#DEFINE C_PROCEDURE_NOT_CLOSED_ON_LINE_LOC "Procedure not closed. Last line of code must be ENDPROC. [<>]" +#DEFINE C_PROCEDURE_NOT_CLOSED_ON_LINE_LOC "Procedure not closed. Last line of code must be ENDPROC. [<>, Recno:<>]" #DEFINE C_PROCESSING_LOC "Processing file" #DEFINE C_PROCESS_PROGRESS_LOC "Process Progress:" #DEFINE C_PROPERTY_NAME_NOT_RECOGNIZED_LOC "Property [<>] is not recognized."