From a55b15c993c43b636774ecce4419760323a8e104 Mon Sep 17 00:00:00 2001 From: fdbozzo Date: Sat, 22 Nov 2014 19:36:54 +0100 Subject: [PATCH 1/5] =?UTF-8?q?Changeset:=20511=20fdbozzo=20-=2022/11/2014?= =?UTF-8?q?=2015:56:57:=20-=20Mejora=20en=20la=20b=C3=BAsqueda=20de=20regi?= =?UTF-8?q?stros=20ignorando=20la=20capitalizaci=C3=B3n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- foxbin2prg.prg | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/foxbin2prg.prg b/foxbin2prg.prg index 95b393f..c7af5b1 100644 --- a/foxbin2prg.prg +++ b/foxbin2prg.prg @@ -2825,6 +2825,7 @@ DEFINE CLASS c_conversor_base AS SESSION SET SAFETY OFF SET TABLEPROMPT OFF SET BLOCKSIZE TO 0 + SET EXACT ON PUBLIC C_FB2PRG_CODE C_FB2PRG_CODE = '' && Contendrá todo el código generado @@ -10887,7 +10888,7 @@ DEFINE CLASS c_conversor_vcx_a_prg AS c_conversor_bin_a_prg ENDIF - SCAN ALL FOR TABLABIN.PLATFORM = "WINDOWS" AND TABLABIN.RESERVED1=="Class" + SCAN ALL FOR UPPER( TABLABIN.PLATFORM ) = "WINDOWS" AND PROPER( TABLABIN.RESERVED1 ) == "Class" STORE 0 TO lnMethodCount STORE '' TO laMethods, laCode, lcCodigo lnClassCount = lnClassCount + 1 @@ -10905,8 +10906,8 @@ DEFINE CLASS c_conversor_vcx_a_prg AS c_conversor_bin_a_prg loRegClass.UNIQUEID = ALLTRIM(loRegClass.UNIQUEID) ENDIF - lcObjName = ALLTRIM(loRegClass.OBJNAME) - laClasses(lnClassCount,1) = LOWER(lcObjName) + lcObjName = LOWER( ALLTRIM( loRegClass.OBJNAME ) ) + laClasses(lnClassCount,1) = lcObjName .write_DEFINE_CLASS( @la_NombresObjsOle, @loRegClass, @lcCodigo ) @@ -10923,9 +10924,9 @@ DEFINE CLASS c_conversor_vcx_a_prg AS c_conversor_bin_a_prg *------------------------------------------------------------------------------- lnObjCount = 0 lnRecno = RECNO() - LOCATE FOR TABLABIN.PLATFORM = "WINDOWS" AND ALLTRIM(GETWORDNUM(TABLABIN.PARENT, 1, '.')) == lcObjName + LOCATE FOR UPPER( TABLABIN.PLATFORM ) = "WINDOWS" AND LOWER( ALLTRIM( GETWORDNUM( TABLABIN.PARENT, 1, '.' ) ) ) == lcObjName - SCAN REST WHILE TABLABIN.PLATFORM = "WINDOWS" AND ALLTRIM(GETWORDNUM(TABLABIN.PARENT, 1, '.')) == lcObjName + SCAN REST WHILE UPPER( TABLABIN.PLATFORM ) = "WINDOWS" AND LOWER( ALLTRIM( GETWORDNUM( TABLABIN.PARENT, 1, '.' ) ) ) == lcObjName lnObjCount = lnObjCount + 1 DIMENSION laObjs(lnObjCount,3) loRegObj = NULL @@ -10986,11 +10987,11 @@ DEFINE CLASS c_conversor_vcx_a_prg AS c_conversor_bin_a_prg *-- RECORRO LOS OBJETOS DENTRO DE LA CLASE ACTUAL PARA OBTENER SUS MÉTODOS lnRecno = RECNO() - LOCATE FOR TABLABIN.PLATFORM = "WINDOWS" AND ALLTRIM(GETWORDNUM(TABLABIN.PARENT, 1, '.')) == lcObjName + LOCATE FOR UPPER( TABLABIN.PLATFORM ) = "WINDOWS" AND LOWER( ALLTRIM( GETWORDNUM( TABLABIN.PARENT, 1, '.' ) ) ) == lcObjName SCAN REST ; - FOR TABLABIN.PLATFORM = "WINDOWS" AND NOT TABLABIN.RESERVED1=="Class" ; - WHILE ALLTRIM(GETWORDNUM(TABLABIN.PARENT, 1, '.')) == lcObjName + FOR UPPER( TABLABIN.PLATFORM ) = "WINDOWS" AND NOT PROPER( TABLABIN.RESERVED1 ) == "Class" ; + WHILE LOWER( ALLTRIM( GETWORDNUM( TABLABIN.PARENT, 1, '.' ) ) ) == lcObjName loRegObj = NULL SCATTER MEMO NAME loRegObj @@ -11148,8 +11149,8 @@ DEFINE CLASS c_conversor_scx_a_prg AS c_conversor_bin_a_prg SCAN ALL FOR TABLABIN.PLATFORM = "WINDOWS" ; - AND (EMPTY(TABLABIN.PARENT) ; - AND (TABLABIN.BASECLASS == 'dataenvironment' OR TABLABIN.BASECLASS == 'form' OR TABLABIN.BASECLASS == 'formset' ) ) + AND ( EMPTY( TABLABIN.PARENT ) ; + AND INLIST( LOWER( TABLABIN.BASECLASS ), 'dataenvironment', 'form', 'formset' ) ) STORE 0 TO lnMethodCount STORE '' TO laMethods, laCode, lcCodigo @@ -11168,8 +11169,8 @@ DEFINE CLASS c_conversor_scx_a_prg AS c_conversor_bin_a_prg loRegClass.UNIQUEID = ALLTRIM(loRegClass.UNIQUEID) ENDIF - lcObjName = ALLTRIM(loRegClass.OBJNAME) - laClasses(lnClassCount,1) = LOWER(lcObjName) + lcObjName = LOWER( ALLTRIM(loRegClass.OBJNAME) ) + laClasses(lnClassCount,1) = lcObjName .write_DEFINE_CLASS( @la_NombresObjsOle, @loRegClass, @lcCodigo ) @@ -11186,9 +11187,9 @@ DEFINE CLASS c_conversor_scx_a_prg AS c_conversor_bin_a_prg *------------------------------------------------------------------------------- lnObjCount = 0 lnRecno = RECNO() - LOCATE FOR TABLABIN.PLATFORM = "WINDOWS" AND ALLTRIM(GETWORDNUM(TABLABIN.PARENT, 1, '.')) == lcObjName + LOCATE FOR UPPER( TABLABIN.PLATFORM ) = "WINDOWS" AND LOWER( ALLTRIM( GETWORDNUM( TABLABIN.PARENT, 1, '.' ) ) ) == lcObjName - SCAN REST WHILE TABLABIN.PLATFORM = "WINDOWS" AND ALLTRIM(GETWORDNUM(TABLABIN.PARENT, 1, '.')) == lcObjName + SCAN REST WHILE UPPER( TABLABIN.PLATFORM ) = "WINDOWS" AND LOWER( ALLTRIM( GETWORDNUM( TABLABIN.PARENT, 1, '.' ) ) ) == lcObjName lnObjCount = lnObjCount + 1 DIMENSION laObjs(lnObjCount,3) loRegObj = NULL @@ -11250,13 +11251,13 @@ DEFINE CLASS c_conversor_scx_a_prg AS c_conversor_bin_a_prg *-- RECORRO LOS OBJETOS DENTRO DE LA CLASE ACTUAL PARA OBTENER SUS MÉTODOS lnRecno = RECNO() - LOCATE FOR TABLABIN.PLATFORM = "WINDOWS" AND ALLTRIM(GETWORDNUM(TABLABIN.PARENT, 1, '.')) == lcObjName + LOCATE FOR TABLABIN.PLATFORM = "WINDOWS" AND LOWER( ALLTRIM( GETWORDNUM( TABLABIN.PARENT, 1, '.' ) ) ) == lcObjName SCAN REST ; - FOR TABLABIN.PLATFORM = "WINDOWS" ; + FOR UPPER( TABLABIN.PLATFORM ) = "WINDOWS" ; AND NOT (EMPTY(TABLABIN.PARENT) ; - AND (TABLABIN.BASECLASS == 'dataenvironment' OR TABLABIN.BASECLASS == 'form' OR TABLABIN.BASECLASS == 'formset' ) ) ; - WHILE ALLTRIM(GETWORDNUM(TABLABIN.PARENT, 1, '.')) == lcObjName + AND ( INLIST( LOWER( TABLABIN.BASECLASS ), 'dataenvironment' , 'form', 'formset' ) ) ) ; + WHILE LOWER( ALLTRIM( GETWORDNUM( TABLABIN.PARENT, 1, '.' ) ) ) == lcObjName loRegObj = NULL SCATTER MEMO NAME loRegObj From 6ca039c68b9c42eb8d762d84d80475b08da87405 Mon Sep 17 00:00:00 2001 From: fdbozzo Date: Sun, 23 Nov 2014 02:27:03 +0100 Subject: [PATCH 2/5] =?UTF-8?q?Changeset:=20514=20fdbozzo=20-=2022/11/2014?= =?UTF-8?q?=2019:47:12:=20-=20Encapsulaci=C3=B3n=20y=20optimizaci=C3=B3n?= =?UTF-8?q?=20en=20nuevo=20m=C3=A9todo=20"Classify=5FPAM=5FHidden=5FProtec?= =?UTF-8?q?ted"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- foxbin2prg.prg | 102 +++++++++++++++++++++++++------------------------ 1 file changed, 52 insertions(+), 50 deletions(-) diff --git a/foxbin2prg.prg b/foxbin2prg.prg index c7af5b1..4794ae4 100644 --- a/foxbin2prg.prg +++ b/foxbin2prg.prg @@ -8947,8 +8947,10 @@ DEFINE CLASS c_conversor_bin_a_prg AS c_conversor_base #IF .F. LOCAL THIS AS c_conversor_bin_a_prg OF 'FOXBIN2PRG.PRG' #ENDIF + _MEMBERDATA = [] ; + [] ; + + [] ; + [] ; + [] ; + [] ; @@ -9011,6 +9013,54 @@ DEFINE CLASS c_conversor_bin_a_prg AS c_conversor_base ENDPROC + PROCEDURE Classify_PAM_Hidden_Protected + *--------------------------------------------------------------------------------------------------- + * PARÁMETROS: (v=Pasar por valor | @=Pasar por referencia) (!=Obligatorio | ?=Opcional) (IN/OUT) + * tnPropsAndValues_Count (@! IN ) + * taPropsAndValues (@! IN ) + * tnProtected_Count (@! IN ) + * taProtected (@! IN ) + * tnPropsAndComments_Count (@! IN ) + * taPropsAndComments (@! IN ) + * tcHiddenProp (@! OUT) Lista de propiedades Hidden + * tcProtectedProp (@! OUT) Lista de propiedades Protected + *--------------------------------------------------------------------------------------------------- + LPARAMETERS tnPropsAndValues_Count, taPropsAndValues, tnProtected_Count, taProtected ; + , tnPropsAndComments_Count, taPropsAndComments, tcHiddenProp, tcProtectedProp + + IF tnPropsAndValues_Count > 0 THEN + *-- Recorro las propiedades (campo Properties) para ir conformando + *-- las definiciones HIDDEN y PROTECTED + LOCAL lcProp, I + + STORE '' TO tcHiddenProp, tcProtectedProp + + FOR I = 1 TO tnProtected_Count + DO CASE + CASE EMPTY( taProtected(I) ) + LOOP + + CASE RIGHT( taProtected(I), 1 ) == '^' + *-- Hidden Property or method + lcProp = CHRTRAN( taProtected(I), '^', '' ) + IF ASCAN(taPropsAndComments, '*' + lcProp, 1, 0, 1, 1+2+4) > 0 + LOOP && method + ENDIF + tcHiddenProp = tcHiddenProp + ',' + lcProp + + OTHERWISE + *-- Protected Property or method + IF ASCAN(taPropsAndComments, '*' + taProtected(I), 1, 0, 1, 1+2+4) > 0 + LOOP && method + ENDIF + tcProtectedProp = tcProtectedProp + ',' + taProtected(I) + ENDCASE + ENDFOR + + ENDIF + ENDPROC + + ******************************************************************************************************************* PROCEDURE get_ADD_OBJECT_METHODS LPARAMETERS toRegObj, toRegClass, tcMethods, taMethods, taCode, tnMethodCount ; @@ -9959,58 +10009,10 @@ DEFINE CLASS c_conversor_bin_a_prg AS c_conversor_base .get_PropsFrom_PROTECTED( toRegClass.PROTECTED, .T., @taProtected, @tnProtected_Count, '' ) IF tnPropsAndValues_Count > 0 THEN - *-- Recorro las propiedades (campo Properties) para ir conformando - *-- las definiciones HIDDEN y PROTECTED - FOR I = 1 TO tnPropsAndValues_Count - IF EMPTY(taPropsAndValues(I,1)) - LOOP - ENDIF - - IF tnProtected_Count = 0 - lnProtectedItem = 0 - ELSE - lnProtectedItem = ASCAN(taProtected, taPropsAndValues(I,1), 1, 0, 0, 1) - ENDIF - - DO CASE - CASE lnProtectedItem = 0 - *-- Propiedad común - - CASE LOWER( taProtected(lnProtectedItem) ) == LOWER( taPropsAndValues(I,1) ) - *-- Propiedad protegida - lcProtectedProp = lcProtectedProp + ',' + taPropsAndValues(I,1) - - CASE LOWER( taProtected(lnProtectedItem) ) == LOWER( taPropsAndValues(I,1) + '^' ) - *-- Propiedad oculta - lcHiddenProp = lcHiddenProp + ',' + taPropsAndValues(I,1) - - ENDCASE - ENDFOR - - *-- Segunda barrida para las propiedades Hidden/Protected que no estén definidas en Properties - FOR I = 1 TO tnProtected_Count - *-- La propiedad evaluada no debe ser vacía, debe estar en la lista de PROPERTIES y no debe ser un *Método - IF EMPTY(taProtected(I,1)) ; - OR ASCAN(taPropsAndValues, CHRTRAN( taProtected(I), '^', '' ), 1, 0, 1, 1) > 0 ; - OR ASCAN(taPropsAndComments, '*' + CHRTRAN( taProtected(I), '^', '' ), 1, 0, 1, 1) > 0 - LOOP - ENDIF - - IF RIGHT( taProtected(I), 1 ) == '^' - *-- Propiedad oculta - lcHiddenProp = lcHiddenProp + ',' + CHRTRAN( taProtected(I), '^', '' ) - - ELSE - *-- Propiedad protegida - lcProtectedProp = lcProtectedProp + ',' + taProtected(I) - - ENDIF - ENDFOR - + .Classify_PAM_Hidden_Protected( @tnPropsAndValues_Count, @taPropsAndValues, @tnProtected_Count, @taProtected ; + , @tnPropsAndComments_Count, @taPropsAndComments, @lcHiddenProp, @lcProtectedProp ) .write_DEFINED_PAM( @taPropsAndComments, tnPropsAndComments_Count, @tcCodigo ) - .write_HIDDEN_Properties( @lcHiddenProp, @tcCodigo ) - .write_PROTECTED_Properties( @lcProtectedProp, @tcCodigo ) *-- Escribo las propiedades de la clase y sus comentarios (los comentarios aquí son redundantes) From 5ab9309dd6cb2a1438b532945167f18886f5659e Mon Sep 17 00:00:00 2001 From: fdbozzo Date: Sun, 23 Nov 2014 17:36:22 +0100 Subject: [PATCH 3/5] =?UTF-8?q?Changeset:=20515=20fdbozzo=20-=2023/11/2014?= =?UTF-8?q?=2012:07:18:=20-=20Mejoras=20en=20normalizaci=C3=B3n=20de=20cap?= =?UTF-8?q?italizaci=C3=B3n=20-=20Quitados=20los=20datos=20innecesarios=20?= =?UTF-8?q?y=20redundantes=20de=20los=20objetos=20OLE=20(Nombre,=20Parent,?= =?UTF-8?q?=20ObjName)=20-=20Mejoras=20en=20ASCAN()=20para=20b=C3=BAsqueda?= =?UTF-8?q?s=20exactas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- foxbin2prg.prg | 90 +++++++++++++++++++++++++++++++++++--------------- 1 file changed, 64 insertions(+), 26 deletions(-) diff --git a/foxbin2prg.prg b/foxbin2prg.prg index 4794ae4..2dec675 100644 --- a/foxbin2prg.prg +++ b/foxbin2prg.prg @@ -9205,11 +9205,19 @@ DEFINE CLASS c_conversor_bin_a_prg AS c_conversor_base PROCEDURE get_NombresObjetosOLEPublic LPARAMETERS ta_NombresObjsOle *-- Obtengo los objetos "OLEPublic" + LOCAL I + SELECT PADR(OBJNAME,100) OBJNAME ; FROM TABLABIN ; WHERE TABLABIN.PLATFORM = "COMMENT" AND TABLABIN.RESERVED2 == "OLEPublic" ; ORDER BY 1 ; INTO ARRAY ta_NombresObjsOle + + FOR I = 1 TO _TALLY + ta_NombresObjsOle(I) = ALLTRIM( ta_NombresObjsOle(I) ) + ENDFOR + + RETURN ENDPROC @@ -9244,10 +9252,10 @@ DEFINE CLASS c_conversor_bin_a_prg AS c_conversor_base lnPos = AT(' ', laLines(I)) && Un espacio separa la propiedad de su comentario (si tiene) IF lnPos = 0 - taPropsAndComments(I,1) = laLines(I) + taPropsAndComments(I,1) = LOWER( laLines(I) ) taPropsAndComments(I,2) = '' ELSE - taPropsAndComments(I,1) = LEFT( laLines(I), lnPos - 1 ) + taPropsAndComments(I,1) = LOWER( LEFT( laLines(I), lnPos - 1 ) ) taPropsAndComments(I,2) = SUBSTR( laLines(I), lnPos + 1 ) ENDIF ENDFOR @@ -9349,7 +9357,7 @@ DEFINE CLASS c_conversor_bin_a_prg AS c_conversor_base *-- Propiedad normal lnPosEQ = AT( '=', laItems(I) ) taPropsAndValues(X,1) = LEFT( laItems(I), lnPosEQ - 2 ) - taPropsAndValues(X,2) = .normalizarValorPropiedad( taPropsAndValues(X,1), LTRIM( SUBSTR( laItems(I), lnPosEQ + 2 ) ), '' ) + taPropsAndValues(X,2) = .normalizarValorPropiedad( taPropsAndValues(X,1), LTRIM( SUBSTR( laItems(I), lnPosEQ + 2 ) ), '' ) ENDIF ENDFOR @@ -9417,7 +9425,8 @@ DEFINE CLASS c_conversor_bin_a_prg AS c_conversor_base FOR I = tnProtected_Count TO 1 STEP -1 *-- El ASCAN es para evitar valores repetidos, que se eliminarán. v1.19.29 - IF ASCAN( taProtected, taProtected(I), 1, -1, 0,1+2+4 ) = I + taProtected(I) = LOWER( taProtected(I) ) + IF ASCAN( taProtected, taProtected(I), 1, -1, 0, 1+2+4 ) = I tcSortedMemo = tcSortedMemo + LOWER(taProtected(I)) + CR_LF ELSE ADEL( taProtected, I ) @@ -9920,10 +9929,7 @@ DEFINE CLASS c_conversor_bin_a_prg AS c_conversor_base *-- Agrego metainformación para objetos OLE IF toRegObj.BASECLASS == 'olecontrol' TEXT TO tcCodigo ADDITIVE TEXTMERGE NOSHOW FLAGS 1 PRETEXT 1+2+4+8 - <<>> Nombre="<>" - Parent="<>" - ObjName="<>" - OLEObject="< 0 ) + llOleObject = ( ASCAN( ta_NombresObjsOle, toRegClass.OBJNAME, 1, 0, 1, 1+2+4+8) > 0 ) IF NOT EMPTY(toRegClass.CLASSLOC) lcOF_Classlib = 'OF "' + LOWER(ALLTRIM(toRegClass.CLASSLOC)) + '" ' @@ -10132,7 +10138,7 @@ DEFINE CLASS c_conversor_bin_a_prg AS c_conversor_base *-- DEFINICIÓN DE LA CLASE ( DEFINE CLASS 'className' AS 'classType' [OF 'classLib'] [OLEPUBLIC] ) TEXT TO tcCodigo ADDITIVE TEXTMERGE NOSHOW FLAGS 1+2 PRETEXT 1+2 - <<'DEFINE CLASS'>> <> AS <> <> + <<'DEFINE CLASS'>> <> AS <> <> ENDTEXT RETURN @@ -10854,7 +10860,7 @@ DEFINE CLASS c_conversor_vcx_a_prg AS c_conversor_bin_a_prg , lnClassCount, lcOutputFile, lcExternalHeader STORE 0 TO lnCodError, lnLastClass, lnObjCount, lnPropsAndValues_Count, lnPropsAndComments_Count, lnProtected_Count ; , lnMethodCount, lnClassCount - STORE '' TO laMethods, laCode, laProtected, laPropsAndComments, laObjs, lcCodigo, laClasses(1,2), lcOutputFile ; + STORE '' TO laMethods, laCode, laProtected, laPropsAndComments, laObjs, lcCodigo, laClasses, lcOutputFile ; , C_FB2PRG_CODE, lcExternalHeader STORE NULL TO loRegClass, loRegObj @@ -10899,6 +10905,11 @@ DEFINE CLASS c_conversor_vcx_a_prg AS c_conversor_bin_a_prg loRegClass = NULL SCATTER MEMO NAME loRegClass + *-- Normalización de capitalización y de datos según parametrización + loRegClass.BASECLASS = LOWER( loRegClass.BASECLASS ) + loRegClass.CLASSLOC = LOWER( loRegClass.CLASSLOC ) + loRegClass.CLASS = LOWER( loRegClass.CLASS ) + IF toFoxBin2Prg.l_NoTimestamps loRegClass.TIMESTAMP = 0 ENDIF @@ -10908,8 +10919,8 @@ DEFINE CLASS c_conversor_vcx_a_prg AS c_conversor_bin_a_prg loRegClass.UNIQUEID = ALLTRIM(loRegClass.UNIQUEID) ENDIF - lcObjName = LOWER( ALLTRIM( loRegClass.OBJNAME ) ) - laClasses(lnClassCount,1) = lcObjName + lcObjName = ALLTRIM( loRegClass.OBJNAME ) + laClasses(lnClassCount,1) = LOWER( lcObjName ) .write_DEFINE_CLASS( @la_NombresObjsOle, @loRegClass, @lcCodigo ) @@ -10926,13 +10937,19 @@ DEFINE CLASS c_conversor_vcx_a_prg AS c_conversor_bin_a_prg *------------------------------------------------------------------------------- lnObjCount = 0 lnRecno = RECNO() - LOCATE FOR UPPER( TABLABIN.PLATFORM ) = "WINDOWS" AND LOWER( ALLTRIM( GETWORDNUM( TABLABIN.PARENT, 1, '.' ) ) ) == lcObjName + LOCATE FOR UPPER( TABLABIN.PLATFORM ) = "WINDOWS" AND LOWER( ALLTRIM( GETWORDNUM( TABLABIN.PARENT, 1, '.' ) ) ) == LOWER(lcObjName) - SCAN REST WHILE UPPER( TABLABIN.PLATFORM ) = "WINDOWS" AND LOWER( ALLTRIM( GETWORDNUM( TABLABIN.PARENT, 1, '.' ) ) ) == lcObjName + SCAN REST WHILE UPPER( TABLABIN.PLATFORM ) = "WINDOWS" AND LOWER( ALLTRIM( GETWORDNUM( TABLABIN.PARENT, 1, '.' ) ) ) == LOWER(lcObjName) lnObjCount = lnObjCount + 1 DIMENSION laObjs(lnObjCount,3) loRegObj = NULL SCATTER MEMO NAME loRegObj + + *-- Normalización de capitalización y de datos según parametrización + loRegObj.BASECLASS = LOWER( loRegObj.BASECLASS ) + loRegObj.CLASSLOC = LOWER( loRegObj.CLASSLOC ) + loRegObj.CLASS = LOWER( loRegObj.CLASS ) + laObjs(lnObjCount,1) = loRegObj laObjs(lnObjCount,2) = RECNO() && ZOrder laObjs(lnObjCount,3) = lnObjCount && Alphabetic order @@ -10989,15 +11006,20 @@ DEFINE CLASS c_conversor_vcx_a_prg AS c_conversor_bin_a_prg *-- RECORRO LOS OBJETOS DENTRO DE LA CLASE ACTUAL PARA OBTENER SUS MÉTODOS lnRecno = RECNO() - LOCATE FOR UPPER( TABLABIN.PLATFORM ) = "WINDOWS" AND LOWER( ALLTRIM( GETWORDNUM( TABLABIN.PARENT, 1, '.' ) ) ) == lcObjName + LOCATE FOR UPPER( TABLABIN.PLATFORM ) = "WINDOWS" AND LOWER( ALLTRIM( GETWORDNUM( TABLABIN.PARENT, 1, '.' ) ) ) == LOWER(lcObjName) SCAN REST ; FOR UPPER( TABLABIN.PLATFORM ) = "WINDOWS" AND NOT PROPER( TABLABIN.RESERVED1 ) == "Class" ; - WHILE LOWER( ALLTRIM( GETWORDNUM( TABLABIN.PARENT, 1, '.' ) ) ) == lcObjName + WHILE LOWER( ALLTRIM( GETWORDNUM( TABLABIN.PARENT, 1, '.' ) ) ) == LOWER(lcObjName) loRegObj = NULL SCATTER MEMO NAME loRegObj + *-- Normalización de capitalización y de datos según parametrización + loRegObj.BASECLASS = LOWER( loRegObj.BASECLASS ) + loRegObj.CLASSLOC = LOWER( loRegObj.CLASSLOC ) + loRegObj.CLASS = LOWER( loRegObj.CLASS ) + IF toFoxBin2Prg.l_NoTimestamps loRegObj.TIMESTAMP = 0 ENDIF @@ -11104,7 +11126,7 @@ DEFINE CLASS c_conversor_scx_a_prg AS c_conversor_bin_a_prg , lnClassCount, lcOutputFile, lcExternalHeader STORE 0 TO lnCodError, lnLastClass, lnObjCount, lnPropsAndValues_Count, lnPropsAndComments_Count, lnProtected_Count ; , lnMethodCount, lnClassCount - STORE '' TO laMethods, laCode, laProtected, laPropsAndComments, laObjs, lcCodigo, laClasses(1,2), lcOutputFile ; + STORE '' TO laMethods, laCode, laProtected, laPropsAndComments, laObjs, lcCodigo, laClasses, lcOutputFile ; , C_FB2PRG_CODE, lcExternalHeader STORE NULL TO loRegClass, loRegObj @@ -11162,6 +11184,11 @@ DEFINE CLASS c_conversor_scx_a_prg AS c_conversor_bin_a_prg loRegClass = NULL SCATTER MEMO NAME loRegClass + *-- Normalización de capitalización y de datos según parametrización + loRegClass.BASECLASS = LOWER( loRegClass.BASECLASS ) + loRegClass.CLASSLOC = LOWER( loRegClass.CLASSLOC ) + loRegClass.CLASS = LOWER( loRegClass.CLASS ) + IF toFoxBin2Prg.l_NoTimestamps loRegClass.TIMESTAMP = 0 ENDIF @@ -11171,8 +11198,8 @@ DEFINE CLASS c_conversor_scx_a_prg AS c_conversor_bin_a_prg loRegClass.UNIQUEID = ALLTRIM(loRegClass.UNIQUEID) ENDIF - lcObjName = LOWER( ALLTRIM(loRegClass.OBJNAME) ) - laClasses(lnClassCount,1) = lcObjName + lcObjName = ALLTRIM(loRegClass.OBJNAME) + laClasses(lnClassCount,1) = LOWER( lcObjName ) .write_DEFINE_CLASS( @la_NombresObjsOle, @loRegClass, @lcCodigo ) @@ -11189,13 +11216,19 @@ DEFINE CLASS c_conversor_scx_a_prg AS c_conversor_bin_a_prg *------------------------------------------------------------------------------- lnObjCount = 0 lnRecno = RECNO() - LOCATE FOR UPPER( TABLABIN.PLATFORM ) = "WINDOWS" AND LOWER( ALLTRIM( GETWORDNUM( TABLABIN.PARENT, 1, '.' ) ) ) == lcObjName + LOCATE FOR UPPER( TABLABIN.PLATFORM ) = "WINDOWS" AND LOWER( ALLTRIM( GETWORDNUM( TABLABIN.PARENT, 1, '.' ) ) ) == LOWER(lcObjName) - SCAN REST WHILE UPPER( TABLABIN.PLATFORM ) = "WINDOWS" AND LOWER( ALLTRIM( GETWORDNUM( TABLABIN.PARENT, 1, '.' ) ) ) == lcObjName + SCAN REST WHILE UPPER( TABLABIN.PLATFORM ) = "WINDOWS" AND LOWER( ALLTRIM( GETWORDNUM( TABLABIN.PARENT, 1, '.' ) ) ) == LOWER(lcObjName) lnObjCount = lnObjCount + 1 DIMENSION laObjs(lnObjCount,3) loRegObj = NULL SCATTER MEMO NAME loRegObj + + *-- Normalización de capitalización y de datos según parametrización + loRegObj.BASECLASS = LOWER( loRegObj.BASECLASS ) + loRegObj.CLASSLOC = LOWER( loRegObj.CLASSLOC ) + loRegObj.CLASS = LOWER( loRegObj.CLASS ) + laObjs(lnObjCount,1) = loRegObj laObjs(lnObjCount,2) = RECNO() && ZOrder laObjs(lnObjCount,3) = lnObjCount && Orden alfabético @@ -11253,17 +11286,22 @@ DEFINE CLASS c_conversor_scx_a_prg AS c_conversor_bin_a_prg *-- RECORRO LOS OBJETOS DENTRO DE LA CLASE ACTUAL PARA OBTENER SUS MÉTODOS lnRecno = RECNO() - LOCATE FOR TABLABIN.PLATFORM = "WINDOWS" AND LOWER( ALLTRIM( GETWORDNUM( TABLABIN.PARENT, 1, '.' ) ) ) == lcObjName + LOCATE FOR TABLABIN.PLATFORM = "WINDOWS" AND LOWER( ALLTRIM( GETWORDNUM( TABLABIN.PARENT, 1, '.' ) ) ) == LOWER(lcObjName) SCAN REST ; FOR UPPER( TABLABIN.PLATFORM ) = "WINDOWS" ; AND NOT (EMPTY(TABLABIN.PARENT) ; AND ( INLIST( LOWER( TABLABIN.BASECLASS ), 'dataenvironment' , 'form', 'formset' ) ) ) ; - WHILE LOWER( ALLTRIM( GETWORDNUM( TABLABIN.PARENT, 1, '.' ) ) ) == lcObjName + WHILE LOWER( ALLTRIM( GETWORDNUM( TABLABIN.PARENT, 1, '.' ) ) ) == LOWER(lcObjName) loRegObj = NULL SCATTER MEMO NAME loRegObj + *-- Normalización de capitalización y de datos según parametrización + loRegObj.BASECLASS = LOWER( loRegObj.BASECLASS ) + loRegObj.CLASSLOC = LOWER( loRegObj.CLASSLOC ) + loRegObj.CLASS = LOWER( loRegObj.CLASS ) + IF toFoxBin2Prg.l_NoTimestamps loRegObj.TIMESTAMP = 0 ENDIF @@ -12350,7 +12388,7 @@ DEFINE CLASS c_conversor_dbf_a_prg AS c_conversor_bin_a_prg *-- Cierro DBC FOR I = 1 TO ADATABASES(laDatabases2) - IF ASCAN( laDatabases, laDatabases2(I) ) = 0 + IF ASCAN( laDatabases, laDatabases2(I), 1, 0, 0, 1+2+4 ) = 0 SET DATABASE TO (laDatabases2(I)) CLOSE DATABASES EXIT From c0f84601f6c879e547a6cf2ead778074a679c400 Mon Sep 17 00:00:00 2001 From: fdbozzo Date: Sun, 23 Nov 2014 17:40:49 +0100 Subject: [PATCH 4/5] =?UTF-8?q?Changeset:=20516=20fdbozzo=20-=2023/11/2014?= =?UTF-8?q?=2017:37:54:=20-=20Optimizaci=C3=B3n=20en=20m=C3=A9todo=20"writ?= =?UTF-8?q?e=5FCLASS=5FPROPERTIES"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- foxbin2prg.prg | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/foxbin2prg.prg b/foxbin2prg.prg index 2dec675..9bccdae 100644 --- a/foxbin2prg.prg +++ b/foxbin2prg.prg @@ -10022,17 +10022,19 @@ DEFINE CLASS c_conversor_bin_a_prg AS c_conversor_base .write_PROTECTED_Properties( @lcProtectedProp, @tcCodigo ) *-- Escribo las propiedades de la clase y sus comentarios (los comentarios aquí son redundantes) - FOR I = 1 TO ALEN(taPropsAndValues, 1) + FOR I = 1 TO tnPropsAndValues_Count TEXT TO tcCodigo ADDITIVE TEXTMERGE NOSHOW FLAGS 1+2 PRETEXT 1+2 <<>> <> = <> ENDTEXT - lnComment = ASCAN( taPropsAndComments, taPropsAndValues(I,1), 1, 0, 1, 1+2+4+8) + IF tnPropsAndComments_Count > 0 THEN + lnComment = ASCAN( taPropsAndComments, taPropsAndValues(I,1), 1, 0, 1, 1+2+4+8) - IF lnComment > 0 AND NOT EMPTY(taPropsAndComments(lnComment,2)) - TEXT TO tcCodigo ADDITIVE TEXTMERGE NOSHOW FLAGS 1 PRETEXT 1+2 - <<>> && <> - ENDTEXT + IF lnComment > 0 AND NOT EMPTY(taPropsAndComments(lnComment,2)) + TEXT TO tcCodigo ADDITIVE TEXTMERGE NOSHOW FLAGS 1 PRETEXT 1+2 + <<>> && <> + ENDTEXT + ENDIF ENDIF ENDFOR From 381051471b14a0c47585817f3a7324283fb8efde Mon Sep 17 00:00:00 2001 From: fdbozzo Date: Sun, 23 Nov 2014 18:09:03 +0100 Subject: [PATCH 5/5] =?UTF-8?q?Changeset:=20518=20fdbozzo=20-=2023/11/2014?= =?UTF-8?q?=2017:49:25:=20-=20Arreglo=20de=20capitalizaci=C3=B3n=20en=20DE?= =?UTF-8?q?FINE=20CLASS=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TESTS/ut__foxbin2prg.prg | 2 +- foxbin2prg.prg | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/TESTS/ut__foxbin2prg.prg b/TESTS/ut__foxbin2prg.prg index bc66dcd..c6625b5 100644 --- a/TESTS/ut__foxbin2prg.prg +++ b/TESTS/ut__foxbin2prg.prg @@ -212,7 +212,7 @@ DEFINE CLASS ut__foxbin2prg AS FxuTestCase OF FxuTestCase.prg THIS.assertequals( toReg_Esperado.Reserved8, toReg.Reserved8, "Valor de RESERVED8 para " + lcExtraData ) THIS.assertequals( LEN(toReg_Esperado.Reserved8), LEN(toReg.Reserved8), "Tamaño de RESERVED8 para " + lcExtraData ) - THIS.assertequals( toReg_Esperado.OLE2, toReg.OLE2, "Valor de OLE2 para " + lcExtraData ) + THIS.assertequals( LOWER(toReg_Esperado.OLE2), LOWER(toReg.OLE2), "Valor de OLE2 para " + lcExtraData ) THIS.assertequals( LEN(toReg_Esperado.OLE2), LEN(toReg.OLE2), "Tamaño de OLE2 para " + lcExtraData ) THIS.assertequals( SYS(2007, toReg_Esperado.OLE), SYS(2007, toReg.OLE), "Valor de OLE (Checksum) para " + lcExtraData ) diff --git a/foxbin2prg.prg b/foxbin2prg.prg index 9bccdae..acb448a 100644 --- a/foxbin2prg.prg +++ b/foxbin2prg.prg @@ -5556,7 +5556,7 @@ DEFINE CLASS c_conversor_prg_a_bin AS c_conversor_base STORE '' TO tcProcedureAbierto toClase = CREATEOBJECT('CL_CLASE') - toClase._Nombre = ALLTRIM( STREXTRACT( tcLine, 'DEFINE CLASS ', ' AS ', 1, 1 ) ) + toClase._Nombre = LOWER( ALLTRIM( STREXTRACT( tcLine, 'DEFINE CLASS ', ' AS ', 1, 1 ) ) ) toClase._ObjName = toClase._Nombre toClase._Definicion = ALLTRIM( tcLine ) IF NOT ' OF ' $ UPPER(tcLine) && Puede no tener "OF libreria.vcx" @@ -12780,7 +12780,7 @@ DEFINE CLASS CL_MODULO AS CL_CUS_BASE WITH THIS AS CL_MODULO OF 'FOXBIN2PRG.PRG' FOR X = 1 TO ._Ole_Obj_count - IF ._Ole_Objs(X)._Nombre == tcNombre + IF LOWER(._Ole_Objs(X)._Nombre) == LOWER(tcNombre) llExiste = .T. EXIT ENDIF