From 3e704c439d27ef3eb21a4f06bdac424dd86ffb91 Mon Sep 17 00:00:00 2001 From: fdbozzo Date: Mon, 2 Mar 2015 00:59:54 +0100 Subject: [PATCH 1/4] =?UTF-8?q?Changeset:=20654=20-=20Mejorada=20la=20info?= =?UTF-8?q?rmaci=C3=B3n=20de=20algunos=20errores=20para=20intentar=20descr?= =?UTF-8?q?ibir=20la=20ubicaci=C3=B3n=20con=20m=C3=A1s=20precisi=C3=B3n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- foxbin2prg.prg | 112 +++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 100 insertions(+), 12 deletions(-) diff --git a/foxbin2prg.prg b/foxbin2prg.prg index 3b51f22..65e6536 100644 --- a/foxbin2prg.prg +++ b/foxbin2prg.prg @@ -2412,6 +2412,7 @@ DEFINE CLASS c_foxbin2prg AS CUSTOM DO CASE CASE ATC('-SHOWMSG', ('-' + tcType)) >= 1 + THIS.writeErrorLog_Flush() DO CASE CASE lnCodError = 1799 && Conversion Cancelled @@ -3174,7 +3175,7 @@ DEFINE CLASS c_foxbin2prg AS CUSTOM lcError = 'Error ' + TRANSFORM(toEx.ERRORNO) + ', ' + toEx.MESSAGE + CR_LF ; + toEx.PROCEDURE + ', ' + TRANSFORM(toEx.LINENO) + CR_LF - IF NOT EMPTY(toEx.LINECONTENTS) + IF NOT EMPTY(toEx.LINECONTENTS) AND toEx.ErrorNo <> 1098 lcError = lcError + toEx.LINECONTENTS + CR_LF ENDIF @@ -3739,6 +3740,7 @@ DEFINE CLASS C_CONVERSOR_BASE AS SESSION + [] ; + [] ; + [] ; + + [] ; + [] ; + [] ; + [] ; @@ -3761,6 +3763,7 @@ DEFINE CLASS C_CONVERSOR_BASE AS SESSION + [] ; + [] ; + [] ; + + [] ; + [] ; + [] @@ -3795,6 +3798,7 @@ DEFINE CLASS C_CONVERSOR_BASE AS SESSION c_OriginalFileName = '' c_ClaseActual = '' oFSO = NULL + n_Methods_LineNo = 0 && Número de línea del error dentro de "Methods" @@ -4605,6 +4609,7 @@ DEFINE CLASS C_CONVERSOR_BASE AS SESSION *ERROR 'No se ha encontrado el marcador de fin [' + ta_ID_Bloques(lnPrimerID,2) ; + '] que cierra al marcador de inicio [' + ta_ID_Bloques(lnPrimerID,1) ; + '] de la línea ' + TRANSFORM(taBloquesExclusion(tnBloquesExclusion,1)) + .n_Methods_LineNo = taBloquesExclusion(tnBloquesExclusion,1) ERROR (TEXTMERGE(loLang.C_END_MARKER_NOT_FOUND_LOC)) ENDIF ENDIF @@ -4761,6 +4766,10 @@ DEFINE CLASS C_CONVERSOR_BASE AS SESSION ENDFUNC + PROCEDURE set_UserValue + LPARAMETERS toEx as Exception + ENDPROC + PROCEDURE sortPropsAndValues_SetAndGetSCXPropNames *-------------------------------------------------------------------------------------------------------------- @@ -7496,6 +7505,7 @@ DEFINE CLASS c_conversor_prg_a_vcx AS c_conversor_prg_a_bin _MEMBERDATA = [] ; + [] ; + [] + c_Type = 'VC2' PROCEDURE Convertir @@ -7851,6 +7861,7 @@ DEFINE CLASS c_conversor_prg_a_scx AS c_conversor_prg_a_bin _MEMBERDATA = [] ; + [] ; + [] + c_Type = 'SC2' PROCEDURE Convertir @@ -8211,6 +8222,7 @@ DEFINE CLASS c_conversor_prg_a_pjx AS c_conversor_prg_a_bin + [] ; + [] ; + [] + c_Type = 'PJ2' @@ -9011,6 +9023,7 @@ DEFINE CLASS c_conversor_prg_a_frx AS c_conversor_prg_a_bin + [] ; + [] ; + [] + c_Type = 'FR2' PROCEDURE Convertir @@ -9452,6 +9465,7 @@ DEFINE CLASS c_conversor_prg_a_dbf AS c_conversor_prg_a_bin + [] ; + [] ; + [] + c_Type = 'DB2' PROCEDURE Convertir @@ -9750,6 +9764,7 @@ DEFINE CLASS c_conversor_prg_a_dbc AS c_conversor_prg_a_bin + [] ; + [] ; + [] + c_Type = 'DC2' PROCEDURE Convertir @@ -9930,9 +9945,9 @@ DEFINE CLASS c_conversor_prg_a_mnx AS c_conversor_prg_a_bin + [] ; + [] - - n_MenuType = 0 - c_MenuLocation = '' + c_Type = 'MN2' + n_MenuType = 0 + c_MenuLocation = '' PROCEDURE Convertir @@ -10154,7 +10169,6 @@ DEFINE CLASS c_conversor_bin_a_prg AS C_CONVERSOR_BASE + [] - PROCEDURE Convertir *--------------------------------------------------------------------------------------------------- * PARÁMETROS: (v=Pasar por valor | @=Pasar por referencia) (!=Obligatorio | ?=Opcional) (IN/OUT) @@ -10236,7 +10250,7 @@ DEFINE CLASS c_conversor_bin_a_prg AS C_CONVERSOR_BASE WITH THIS AS c_conversor_bin_a_prg OF 'FOXBIN2PRG.PRG' lnMethodCount = tnMethodCount .Method2Array( toRegObj.METHODS, @taMethods, @taCode, '', @tnMethodCount ; - , @taPropsAndComments, tnPropsAndComments_Count, @taProtected, tnProtected_Count, @toFoxBin2Prg ) + , @taPropsAndComments, tnPropsAndComments_Count, @taProtected, tnProtected_Count, @toFoxBin2Prg, @toRegObj ) *-- Ubico los métodos protegidos y les cambio la definición. *-- Los métodos se deben generar con la ruta completa, porque si no es imposible saber a que objeto corresponden, @@ -10762,6 +10776,56 @@ DEFINE CLASS c_conversor_bin_a_prg AS C_CONVERSOR_BASE ENDPROC + PROCEDURE set_UserValue + LPARAMETERS toEx as Exception + + LOCAL lcMethods, I, lcLine, laCodeLines(1), lcMethod, lcLocation + STORE '' TO lcMethods, lcLine, laCodeLines, lcMethod, lcLocation + + toEx.UserValue = toEx.UserValue + CR_LF + + IF INLIST(THIS.c_Type, 'SCX', 'VCX') THEN + lcMethods = Methods + toEx.UserValue = toEx.UserValue + 'Error location ' + '..............................' + CR_LF + + IF NOT EMPTY(Parent) + lcLocation = lcLocation + Parent + '.' + ENDIF + + lcLocation = lcLocation + ObjName + + *-- Busco el Procedure si hay un n_Methods_LineNo + ALINES(laCodeLines, lcMethods) + + FOR I = THIS.n_Methods_LineNo TO 1 STEP -1 + lcLine = LTRIM( laCodeLines(I), 0, ' ', CHR(9) ) + + DO CASE + CASE LEFT(lcLine, 10) == 'PROCEDURE ' + lcMethod = ALLTRIM( SUBSTR( lcLine, 11) ) + EXIT + + CASE LEFT(lcLine, 9) == 'FUNCTION ' + lcMethod = ALLTRIM( SUBSTR( lcLine, 10) ) + EXIT + + ENDCASE + + ENDFOR + + IF EMPTY(lcMethod) THEN + lcLocation = 'Class: ' + lcLocation + ELSE + lcLocation = 'Method: ' + lcLocation + '.' + lcMethod + ENDIF + + toEx.UserValue = toEx.UserValue + lcLocation + CR_LF + ENDIF + + toEx.UserValue = toEx.UserValue + 'Recno: ' + TRANSFORM(RECNO()) + CR_LF + toEx.UserValue = toEx.UserValue + '.............................................' + CR_LF + ENDPROC + PROCEDURE SortMethod LPARAMETERS tcMethod, taMethods, taCode, tcSorted, tnMethodCount, taPropsAndComments, tnPropsAndComments_Count ; @@ -10834,7 +10898,7 @@ DEFINE CLASS c_conversor_bin_a_prg AS C_CONVERSOR_BASE PROCEDURE Method2Array LPARAMETERS tcMethod, taMethods, taCode, tcSorted, tnMethodCount, taPropsAndComments, tnPropsAndComments_Count ; - , taProtected, tnProtected_Count, toFoxBin2Prg + , taProtected, tnProtected_Count, toFoxBin2Prg, toRegObj *-- 29/10/2013 Fernando D. Bozzo *-- Se tiene en cuenta la posibilidad de que haya un PROC/ENDPROC dentro de un TEXT/ENDTEXT *-- cuando es usado en un generador de código o similar. @@ -11851,6 +11915,7 @@ DEFINE CLASS c_conversor_vcx_a_prg AS c_conversor_bin_a_prg #IF .F. LOCAL THIS AS c_conversor_vcx_a_prg OF 'FOXBIN2PRG.PRG' #ENDIF + c_Type = 'VCX' PROCEDURE Convertir @@ -12039,7 +12104,7 @@ DEFINE CLASS c_conversor_vcx_a_prg AS c_conversor_bin_a_prg lnMethodCount = 0 .Method2Array( loRegClass.METHODS, @laMethods, @laCode, '', @lnMethodCount ; - , @laPropsAndComments, lnPropsAndComments_Count, @laProtected, lnProtected_Count, @toFoxBin2Prg ) + , @laPropsAndComments, lnPropsAndComments_Count, @laProtected, lnProtected_Count, @toFoxBin2Prg, @loRegClass ) .get_CLASS_METHODS( @lnMethodCount, @laMethods, @laCode, @laProtected, @laPropsAndComments ) @@ -12127,6 +12192,8 @@ DEFINE CLASS c_conversor_vcx_a_prg AS c_conversor_bin_a_prg CATCH TO toEx + THIS.set_UserValue(@toEx) + IF THIS.l_Debug AND _VFP.STARTMODE = 0 SET STEP ON ENDIF @@ -12154,6 +12221,7 @@ DEFINE CLASS c_conversor_scx_a_prg AS c_conversor_bin_a_prg #IF .F. LOCAL THIS AS c_conversor_scx_a_prg OF 'FOXBIN2PRG.PRG' #ENDIF + c_Type = 'SCX' PROCEDURE Convertir @@ -12359,7 +12427,7 @@ DEFINE CLASS c_conversor_scx_a_prg AS c_conversor_bin_a_prg lnMethodCount = 0 .Method2Array( loRegClass.METHODS, @laMethods, @laCode, '', @lnMethodCount ; - , @laPropsAndComments, lnPropsAndComments_Count, @laProtected, lnProtected_Count, @toFoxBin2Prg ) + , @laPropsAndComments, lnPropsAndComments_Count, @laProtected, lnProtected_Count, @toFoxBin2Prg, @loRegClass ) .get_CLASS_METHODS( @lnMethodCount, @laMethods, @laCode, @laProtected, @laPropsAndComments ) @@ -12449,6 +12517,8 @@ DEFINE CLASS c_conversor_scx_a_prg AS c_conversor_bin_a_prg CATCH TO toEx + THIS.set_UserValue(@toEx) + IF THIS.l_Debug AND _VFP.STARTMODE = 0 SET STEP ON ENDIF @@ -12476,6 +12546,7 @@ DEFINE CLASS c_conversor_pjx_a_prg AS c_conversor_bin_a_prg #IF .F. LOCAL THIS AS c_conversor_pjx_a_prg OF 'FOXBIN2PRG.PRG' #ENDIF + c_Type = 'PJX' PROCEDURE Convertir @@ -12783,12 +12854,14 @@ DEFINE CLASS c_conversor_pjx_a_prg AS c_conversor_bin_a_prg CATCH TO toEx + THIS.set_UserValue(@toEx) + lnCodError = toEx.ERRORNO DO CASE CASE lnCodError = 2062 && The specified key already exists ==> loProject.ADD( loReg, loReg.NAME ) *toEx.USERVALUE = 'Archivo duplicado: ' + loReg.NAME - toEx.USERVALUE = loLang.C_DUPLICATED_FILE_LOC + ': ' + loReg.NAME + toEx.USERVALUE = toEx.USERVALUE + loLang.C_DUPLICATED_FILE_LOC + ': ' + loReg.NAME ENDCASE IF THIS.l_Debug AND _VFP.STARTMODE = 0 @@ -12815,6 +12888,7 @@ DEFINE CLASS c_conversor_pjm_a_prg AS c_conversor_bin_a_prg #IF .F. LOCAL THIS AS c_conversor_pjm_a_prg OF 'FOXBIN2PRG.PRG' #ENDIF + c_Type = 'PJM' PROCEDURE Convertir @@ -13161,12 +13235,14 @@ DEFINE CLASS c_conversor_pjm_a_prg AS c_conversor_bin_a_prg CATCH TO toEx + THIS.set_UserValue(@toEx) + lnCodError = toEx.ERRORNO DO CASE CASE lnCodError = 2062 && The specified key already exists ==> loProject.ADD( loReg, loReg.NAME ) *toEx.USERVALUE = 'Archivo duplicado: ' + loReg.NAME - toEx.USERVALUE = loLang.C_DUPLICATED_FILE_LOC + ': ' + loReg.NAME + toEx.USERVALUE = toEx.USERVALUE + loLang.C_DUPLICATED_FILE_LOC + ': ' + loReg.NAME ENDCASE IF THIS.l_Debug AND _VFP.STARTMODE = 0 @@ -13197,6 +13273,7 @@ DEFINE CLASS c_conversor_frx_a_prg AS c_conversor_bin_a_prg *_MEMBERDATA = [] ; + [] ; + [] + c_Type = 'FRX' @@ -13338,6 +13415,8 @@ DEFINE CLASS c_conversor_frx_a_prg AS c_conversor_bin_a_prg CATCH TO toEx + THIS.set_UserValue(@toEx) + IF THIS.l_Debug AND _VFP.STARTMODE = 0 SET STEP ON ENDIF @@ -13365,6 +13444,7 @@ DEFINE CLASS c_conversor_dbf_a_prg AS c_conversor_bin_a_prg #IF .F. LOCAL THIS AS c_conversor_dbf_a_prg OF 'FOXBIN2PRG.PRG' #ENDIF + c_Type = 'DBF' PROCEDURE Convertir @@ -13480,6 +13560,8 @@ DEFINE CLASS c_conversor_dbf_a_prg AS c_conversor_bin_a_prg CATCH TO toEx + THIS.set_UserValue(@toEx) + DO CASE CASE toEx.ERRORNO = 13 && Alias not found *toEx.USERVALUE = 'WARNING!!' + CR_LF ; @@ -13488,7 +13570,7 @@ DEFINE CLASS c_conversor_dbf_a_prg AS c_conversor_bin_a_prg + '¡¡ATENCIÓN!!' + CR_LF ; + 'ASEGÚRESE DE QUE NO ESTÁ USANDO UN ALIAS DE TABLA EN LAS EXPRESIONES DE LOS ÍNDICES!! (ej: index on ' ; + UPPER(JUSTSTEM(THIS.c_InputFile)) + '.campo tag nombreclave)' - toEx.USERVALUE = TEXTMERGE(loLang.C_WARN_TABLE_ALIAS_ON_INDEX_EXPRESSION_LOC) + toEx.USERVALUE = toEx.USERVALUE + TEXTMERGE(loLang.C_WARN_TABLE_ALIAS_ON_INDEX_EXPRESSION_LOC) *!* CASE toEx.ErrorNo = 1976 && Cannot resolve backlink *!* toEx.UserValue = 'WARNING!!' + CR_LF ; @@ -13534,6 +13616,7 @@ DEFINE CLASS c_conversor_dbc_a_prg AS c_conversor_bin_a_prg #IF .F. LOCAL THIS AS c_conversor_dbc_a_prg OF 'FOXBIN2PRG.PRG' #ENDIF + c_Type = 'DBC' PROCEDURE Convertir @@ -13581,6 +13664,8 @@ DEFINE CLASS c_conversor_dbc_a_prg AS c_conversor_bin_a_prg CATCH TO toEx + THIS.set_UserValue(@toEx) + IF THIS.l_Debug AND _VFP.STARTMODE = 0 SET STEP ON ENDIF @@ -13604,6 +13689,7 @@ DEFINE CLASS c_conversor_mnx_a_prg AS c_conversor_bin_a_prg #IF .F. LOCAL THIS AS c_conversor_mnx_a_prg OF 'FOXBIN2PRG.PRG' #ENDIF + c_Type = 'MNX' PROCEDURE Convertir @@ -13658,6 +13744,8 @@ DEFINE CLASS c_conversor_mnx_a_prg AS c_conversor_bin_a_prg CATCH TO toEx + THIS.set_UserValue(@toEx) + IF THIS.l_Debug AND _VFP.STARTMODE = 0 SET STEP ON ENDIF From b14d8f74b1a5611c66743a5c7bd591a80879af1f Mon Sep 17 00:00:00 2001 From: fdbozzo Date: Mon, 2 Mar 2015 01:01:27 +0100 Subject: [PATCH 2/4] =?UTF-8?q?Changeset:=20655=20-=20Actualizaci=C3=B3n?= =?UTF-8?q?=20del=20archivo=20de=20versiones?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FoxBin2PRGVersionFile.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/FoxBin2PRGVersionFile.txt b/FoxBin2PRGVersionFile.txt index d3aba30..512e7ea 100644 --- a/FoxBin2PRGVersionFile.txt +++ b/FoxBin2PRGVersionFile.txt @@ -21,6 +21,7 @@ Change History ------------------------------------------------------------- - Added VFP 9 SP1 runtime validation - Bug Fix: Broken SourceSafe compatibility because an error is thrown when querying for file support (Tuvia Vinitsky) - Bug Fix scx/vcx: Process only one TEXT/ENDTEXT nesting level because TEXT/ENDTEXT can't be nested (Lutz Scheffler) +- Make some error descriptions more informative and precise (Lutz Scheffler) 2015/01/18 v1.19.41 - Bug Fix db2: Erroneous detection of Invalid Table when size is less than 328 bytes. Lower limit was changed to 65 bytes. From 657de7c56850d8883b8006ff3d8178bfef769987 Mon Sep 17 00:00:00 2001 From: fdbozzo Date: Mon, 2 Mar 2015 01:05:17 +0100 Subject: [PATCH 3/4] =?UTF-8?q?Changeset:=20656=20Correcci=C3=B3n=20histor?= =?UTF-8?q?ial=20y=20cr=C3=A9ditos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- foxbin2prg.prg | 2 ++ 1 file changed, 2 insertions(+) diff --git a/foxbin2prg.prg b/foxbin2prg.prg index 65e6536..85e8f3a 100644 --- a/foxbin2prg.prg +++ b/foxbin2prg.prg @@ -133,6 +133,7 @@ * 13/01/2015 FDBOZZO v1.19.41 Bug Fix db2: Detección errónea de tabla inválida cuando el tamaño es inferior a 328 bytes. Límite mínimo cambiado a 65 bytes. * 20/01/2015 FDBOZZO v1.19.42 Mejora: Validación de versión de Visual FoxPro, para evitar problemas ajenos a FoxBin2Prg * 25/02/2015 FDBOZZO v1.19.42 Bug Fix scx/vcx: Procesar solo un nivel de text/endtext, ya que no se admiten más niveles (Lutz Scheffler) +* 25/02/2015 FDBOZZO v1.19.42 Mejora: Hacer algunos mensajes de error más descriptivos (Lutz Scheffler) * * *--------------------------------------------------------------------------------------------------- @@ -194,6 +195,7 @@ * 06/01/2015 Mike Potjer Reporte bug db2: [Error 12, Variable "TCOUTPUTFILE" is not found] cuando DBF_Conversion_Support=4 y el archivo de salida es igual al generado (Agregado en v1.19.40) * 13/01/2015 Ryan Harris Reporte bug vcx/scx v1.19.40: Detección errónea de estructuras PROCEDURE/ENDPROC cuando se usan como parámetros LPARAMETERS en línea aparte (Arreglado en v1.19.41) * 25/02/2015 Lutz Scheffler Reporte de Bug scx/vcx v1.19.41: Procesar solo un nivel de text/endtext, ya que no se admiten más niveles (Arreglado en v1.19.42) +* 25/02/2015 Lutz Scheffler Mejora v1.19.41: Hacer algunos mensajes de error más descriptivos (Agregado en v1.19.42) * * *--------------------------------------------------------------------------------------------------- From 43cf365c78a4ea9550e39fbf2ae94db2e4469555 Mon Sep 17 00:00:00 2001 From: fdbozzo Date: Mon, 2 Mar 2015 01:18:44 +0100 Subject: [PATCH 4/4] =?UTF-8?q?Changeset:=20658=20-=20Indicaci=C3=B3n=20de?= =?UTF-8?q?l=20n=C3=BAmero=20de=20l=C3=ADnea=20real=20y=20contenido=20de?= =?UTF-8?q?=20la=20misma?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- foxbin2prg.prg | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/foxbin2prg.prg b/foxbin2prg.prg index 85e8f3a..b0f4f62 100644 --- a/foxbin2prg.prg +++ b/foxbin2prg.prg @@ -10781,8 +10781,9 @@ DEFINE CLASS c_conversor_bin_a_prg AS C_CONVERSOR_BASE PROCEDURE set_UserValue LPARAMETERS toEx as Exception - LOCAL lcMethods, I, lcLine, laCodeLines(1), lcMethod, lcLocation + LOCAL lcMethods, I, lcLine, laCodeLines(1), lcMethod, lcLocation, lnErrorLine STORE '' TO lcMethods, lcLine, laCodeLines, lcMethod, lcLocation + STORE 0 TO lnErrorLine, I toEx.UserValue = toEx.UserValue + CR_LF @@ -10805,10 +10806,12 @@ DEFINE CLASS c_conversor_bin_a_prg AS C_CONVERSOR_BASE DO CASE CASE LEFT(lcLine, 10) == 'PROCEDURE ' lcMethod = ALLTRIM( SUBSTR( lcLine, 11) ) + lnErrorLine = THIS.n_Methods_LineNo - I EXIT CASE LEFT(lcLine, 9) == 'FUNCTION ' lcMethod = ALLTRIM( SUBSTR( lcLine, 10) ) + lnErrorLine = THIS.n_Methods_LineNo - I EXIT ENDCASE @@ -10821,7 +10824,12 @@ DEFINE CLASS c_conversor_bin_a_prg AS C_CONVERSOR_BASE lcLocation = 'Method: ' + lcLocation + '.' + lcMethod ENDIF + IF lnErrorLine > 0 THEN + lcLocation = lcLocation + ', Line ' + TRANSFORM(lnErrorLine) + ENDIF + toEx.UserValue = toEx.UserValue + lcLocation + CR_LF + toEx.UserValue = toEx.UserValue + '> ' + laCodeLines(THIS.n_Methods_LineNo) + CR_LF ENDIF toEx.UserValue = toEx.UserValue + 'Recno: ' + TRANSFORM(RECNO()) + CR_LF