Changeset: 408 v1.19.30

- Cuando la línea anterior a un ENDTEXT termina en ";" o "," no se reconoce como ENDTEXT sino como continuación (Jim Nelson)
- En ciertos casos de herencia no se mantiene el orden alfabetico de algunos metodos (Ryan Harris)
- Agregados casos de prueba de FoxUnit para comprobar la solución de ambos bugs
- Agregados nuevos scripts vbs para recompilación en distintos lenguajes
This commit is contained in:
fdbozzo
2014-08-10 13:27:46 +02:00
15 changed files with 658 additions and 197 deletions

View File

@@ -2,8 +2,8 @@ Lparameters toUpdateInfo
Local lcNote
With toUpdateInfo
.VersionNumber = 'v1.19.29'
.VersionDate = Date(2014,08,01)
.VersionNumber = 'v1.19.30'
.VersionDate = Date(2014,08,07)
.SourceFileUrl = 'http://vfpxrepository.com/dl/thorupdate/Projects/FoxBin2Prg/FoxBin2Prg.Zip'
.Link = 'http://vfpx.codeplex.com/wikipage?title=FoxBin2PRG'
@@ -17,8 +17,13 @@ Demo video using FoxBin2Prg with PlasticSCM: http://youtu.be/sE4wQ50Itqg
Change History -------------------------------------------------------------
2014/08/07 v1.19.30
- Bug Fix vcx/scx: Bad EndText block detection when the previous line ends with "," or ";" (Jim Nelson)
- Bug Fix vcx/scx: Some methods are not alphabetically sorted in some inheritance situations (Ryan Harris)
- Added FoxUnit test cases to bug fix confirmation of both
2014/08/01 v1.19.29
- Bug Fix vcx/scx: Bad text/endtext block detection when there is a line that begins with a "text" field and previous line end with "," in regards of ";" (M_N_M)
- Bug Fix vcx/scx: Bad Text block detection when the previous line ends with "," (M_N_M)
- Optimizations and refactoring
2014/07/26 v1.19.28

View File

@@ -0,0 +1,21 @@
'---------------------------------------------------------------------------------------------------
' FoxBin2Prg__Compilar_en_Espa<70>ol.vbs - 10/08/2014 - Fernando D. Bozzo (fdbozzo@gmail.com)
'---------------------------------------------------------------------------------------------------
' - FoxBin2Prg ya viene en Espa<70>ol por defecto, pero si lo llega a necesitar, solo ejecute este script.
'---------------------------------------------------------------------------------------------------
Const ForReading = 1
Dim WSHShell, FileSystemObject
Dim oVFP9, nExitCode, cOrigFile, cDestFile
Dim nRet
Set WSHShell = WScript.CreateObject("WScript.Shell")
Set FileSystemObject = WScript.CreateObject("Scripting.FileSystemObject")
Set oVFP9 = CreateObject("VisualFoxPro.Application.9")
foxbin2prg_exe = Replace(WScript.ScriptFullName, WScript.ScriptName, "foxbin2prg.exe")
nExitCode = 0
cOrigFile = Replace(WScript.ScriptFullName, WScript.ScriptName, "foxbin2prg.h")
cPath = FileSystemObject.GetParentFolderName( cOrigFile )
nRet = FileSystemObject.DeleteFile( cOrigFile, True )
oVFP9.DoCmd( "SET DEFAULT TO '" & cPath & "'" )
oVFP9.DoCmd( "BUILD EXE foxbin2prg.exe FROM foxbin2prg.pjx RECOMPILE" )
WSHShell.run foxbin2prg_exe
WScript.Quit(nExitCode)

View File

@@ -0,0 +1,22 @@
'---------------------------------------------------------------------------------------------------
' FoxBin2Prg__Compile_in_English.vbs - 10/08/2014 - Fernando D. Bozzo (fdbozzo@gmail.com)
'---------------------------------------------------------------------------------------------------
' - Just execute on FoxBin2Prg main directory, and you get an EXE with texts translated
'---------------------------------------------------------------------------------------------------
Const ForReading = 1
Dim WSHShell, FileSystemObject
Dim oVFP9, nExitCode, cOrigFile, cDestFile
Dim nRet
Set WSHShell = WScript.CreateObject("WScript.Shell")
Set FileSystemObject = WScript.CreateObject("Scripting.FileSystemObject")
Set oVFP9 = CreateObject("VisualFoxPro.Application.9")
foxbin2prg_exe = Replace(WScript.ScriptFullName, WScript.ScriptName, "foxbin2prg.exe")
nExitCode = 0
cOrigFile = Replace(WScript.ScriptFullName, WScript.ScriptName, "foxbin2prg_en.h")
cDestFile = Replace(WScript.ScriptFullName, WScript.ScriptName, "foxbin2prg.h")
cPath = FileSystemObject.GetParentFolderName( cOrigFile )
nRet = FileSystemObject.CopyFile( cOrigFile, cDestFile, True )
oVFP9.DoCmd( "SET DEFAULT TO '" & cPath & "'" )
oVFP9.DoCmd( "BUILD EXE foxbin2prg.exe FROM foxbin2prg.pjx RECOMPILE" )
WSHShell.run foxbin2prg_exe
WScript.Quit(nExitCode)

View File

@@ -0,0 +1,22 @@
'---------------------------------------------------------------------------------------------------
' FoxBin2Prg__kompilieren_auf_Deutsch.vbs - 10/08/2014 - Fernando D. Bozzo (fdbozzo@gmail.com)
'---------------------------------------------------------------------------------------------------
' - F<>hren Sie einfach auf FoxBin2Prg Hauptverzeichnis, und Sie erhalten eine EXE-Datei mit Texten <20>bersetzt bekommen
'---------------------------------------------------------------------------------------------------
Const ForReading = 1
Dim WSHShell, FileSystemObject
Dim oVFP9, nExitCode, cOrigFile, cDestFile
Dim nRet
Set WSHShell = WScript.CreateObject("WScript.Shell")
Set FileSystemObject = WScript.CreateObject("Scripting.FileSystemObject")
Set oVFP9 = CreateObject("VisualFoxPro.Application.9")
foxbin2prg_exe = Replace(WScript.ScriptFullName, WScript.ScriptName, "foxbin2prg.exe")
nExitCode = 0
cOrigFile = Replace(WScript.ScriptFullName, WScript.ScriptName, "foxbin2prg_de.h")
cDestFile = Replace(WScript.ScriptFullName, WScript.ScriptName, "foxbin2prg.h")
cPath = FileSystemObject.GetParentFolderName( cOrigFile )
nRet = FileSystemObject.CopyFile( cOrigFile, cDestFile, True )
oVFP9.DoCmd( "SET DEFAULT TO '" & cPath & "'" )
oVFP9.DoCmd( "BUILD EXE foxbin2prg.exe FROM foxbin2prg.pjx RECOMPILE" )
WSHShell.run foxbin2prg_exe
WScript.Quit(nExitCode)

View File

@@ -0,0 +1,205 @@
*--------------------------------------------------------------------------------------------------------------------------------------------------------
* (ES) AUTOGENERADO - <20><>ATENCI<43>N!! - <20><>NO PENSADO PARA EJECUTAR!! USAR SOLAMENTE PARA INTEGRAR CAMBIOS Y ALMACENAR CON HERRAMIENTAS SCM!!
* (EN) AUTOGENERATED - ATTENTION!! - NOT INTENDED FOR EXECUTION!! USE ONLY FOR MERGING CHANGES AND STORING WITH SCM TOOLS!!
*--------------------------------------------------------------------------------------------------------------------------------------------------------
*< FOXBIN2PRG: Version="1.19" SourceFile="classlib_method_order_bug_test.vcx" /> (Solo para binarios VFP 9 / Only for VFP 9 binaries)
*
*
DEFINE CLASS grdbase AS grid
*< CLASSDATA: Baseclass="grid" Timestamp="" Scale="Pixels" Uniqueid="" />
*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder
*< OBJECTDATA: ObjPath="Column1.Header1" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="Column1.Text1" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="Column2.Header1" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="Column2.Text1" UniqueID="" Timestamp="" />
*<DefinedPropArrayMethod>
*m: canresort
*m: commoncolumnclick && Generic column click handler
*m: createtag && Create a grid indexd tag for sorting
*m: resizecover
*m: visible_assign
*</DefinedPropArrayMethod>
ColumnCount = 2
Height = 200
Name = "grdbase"
Width = 320
Column1.Name = "Column1"
Column2.Name = "Column2"
ADD OBJECT 'Column1.Header1' AS header WITH ;
Caption = "Header1", ;
Name = "Header1"
*< END OBJECT: BaseClass="header" />
ADD OBJECT 'Column1.Text1' AS textbox WITH ;
BackColor = 255,255,255, ;
BorderStyle = 0, ;
ForeColor = 0,0,0, ;
Margin = 0, ;
Name = "Text1"
*< END OBJECT: BaseClass="textbox" />
ADD OBJECT 'Column2.Header1' AS header WITH ;
Caption = "Header1", ;
Name = "Header1"
*< END OBJECT: BaseClass="header" />
ADD OBJECT 'Column2.Text1' AS textbox WITH ;
BackColor = 255,255,255, ;
BorderStyle = 0, ;
ForeColor = 0,0,0, ;
Margin = 0, ;
Name = "Text1"
*< END OBJECT: BaseClass="textbox" />
PROCEDURE canresort
*
* CanResort
*
RETURN .T.
ENDPROC
PROCEDURE Click
*
* Do some things here
*
DODEFAULT()
ENDPROC
PROCEDURE commoncolumnclick && Generic column click handler
*
* Common behavior when clicked
*
LPARAMETERS toColumn
ENDPROC
PROCEDURE createtag && Create a grid indexd tag for sorting
*
* Index on each column's ControlSource
*
ENDPROC
PROCEDURE DblClick
*
* Double-clicked!
*
RETURN DODEFAULT()
ENDPROC
PROCEDURE Destroy
*
* Destroy the grid
*
RETURN .T.
ENDPROC
PROCEDURE Resize
*
* React to resizing the grid
*
ENDPROC
PROCEDURE resizecover
*
* ResizeCover if one exists
*
ENDPROC
PROCEDURE visible_assign
LPARAMETERS vNewVal
*To do: Modify this routine for the Assign method
THIS.Visible = m.vNewVal
ENDPROC
PROCEDURE When
*
* When what?
*
ENDPROC
PROCEDURE Column1.Text1.Click
*
* Call common method
*
this.Parent.Parent.commoncolumnclick(this)
ENDPROC
PROCEDURE Column2.Text1.Click
*
* Call common method
*
this.Parent.Parent.commoncolumnclick(this)
ENDPROC
ENDDEFINE
DEFINE CLASS grdgeneral AS grdbase OF "classlib.vcx"
*< CLASSDATA: Baseclass="grid" Timestamp="" Scale="Pixels" Uniqueid="" />
Name = "grdgeneral"
Column1.Header1.Name = "Header1"
Column1.Name = "Column1"
Column1.Text1.Name = "Text1"
Column2.Header1.Name = "Header1"
Column2.Name = "Column2"
Column2.Text1.Name = "Text1"
PROCEDURE canresort
*
* Call default logic.
*
IF NOT DODEFAULT()
RETURN .F.
ENDIF
ENDPROC
PROCEDURE commoncolumnclick && Generic column click handler
*!******************************************************************************
*!* Method: grdGeneral::CommonColumnClick()
*!* Returns: Logical
LPARAMETERS toColumn
*
* Call default logic.
*
IF NOT DODEFAULT()
RETURN .F.
ENDIF
*
* Measure Success
*
LOCAL llSuccess as Boolean
llSuccess = .T.
** TODO
*
* Return logical, success(T) or failure(F)
*
RETURN llSuccess
ENDPROC
PROCEDURE Init
*
* Call default logic.
*
IF NOT DODEFAULT()
RETURN .F.
ENDIF
ENDPROC
PROCEDURE Column1.Text1.Click
*
* Call default logic.
*
IF NOT DODEFAULT()
RETURN .F.
ENDIF
ENDPROC
ENDDEFINE

View File

@@ -3486,7 +3486,7 @@ DEFINE CLASS f_combobox AS f_base OF "lib_controles.vcx"
WhatsThisHelpID = -1, ;
Width = 200
*< END OBJECT: BaseClass="combobox" />
PROCEDURE Cl_ComboDropdown1.Init
this.AddListItem('Este es el valor.A1')
this.AddListItem('Este es el valor.A2', this.NewItemId, 2)
@@ -13870,7 +13870,7 @@ DEFINE CLASS f_listbox AS f_base OF "lib_controles.vcx"
WhatsThisHelpID = -1, ;
Width = 224
*< END OBJECT: BaseClass="listbox" />
PROCEDURE Cl_ListBox1.Init
this.AddListItem('Este es el valor.A1')
this.AddListItem('Este es el valor.A2', this.NewItemId, 2)

View File

@@ -148,6 +148,7 @@ DEFINE CLASS ut__foxbin2prg AS FxuTestCase OF FxuTestCase.prg
loObj.get_PropsFrom_PROTECTED( toReg_Esperado.PROTECTED, .F., @laProtected_Esperado, @lnProtected_Count_Esperado, '' )
*-- Methods
STORE 0 TO lnMethods_Count, lnMethods_Count_Esperado
loObj.get_ADD_OBJECT_METHODS( toReg, toReg, '', @laMethods, '', @lnMethods_Count, '', 0, '', 0, loFoxBin2Prg )
loObj.get_ADD_OBJECT_METHODS( toReg_Esperado, toReg_Esperado, '', @laMethods_Esperado, '', @lnMethods_Count_Esperado, '', 0, '', 0, loFoxBin2Prg )
lcExtraData = tcParent + '.' + tcObjName + ' (' + tcClass + ')'
@@ -256,7 +257,7 @@ DEFINE CLASS ut__foxbin2prg AS FxuTestCase OF FxuTestCase.prg
THIS.assertequals( lnMethods_Count_Esperado, lnMethods_Count, "Cantidad de METHODS para " + lcExtraData )
FOR I = 1 TO lnMethods_Count_Esperado
THIS.asserttrue( ASCAN( laMethods, laMethods_Esperado(I,1), 1, -1, 1, 0+2+4) > 0 ;
THIS.asserttrue( ASCAN( laMethods, laMethods_Esperado(I,1), 1, -1, 1, 1+2+4) > 0 ;
, ' Comprobaci<63>n de que existe el Method "' + TRANSFORM(laMethods_Esperado(I,1)) + '"' + " para " + lcExtraData )
ENDFOR
@@ -872,6 +873,64 @@ DEFINE CLASS ut__foxbin2prg AS FxuTestCase OF FxuTestCase.prg
ENDFUNC
*******************************************************************************************************************************************
FUNCTION Deberia_Ejecutar_FOXBIN2PRG_ParaLaLibreria_CLASSLIB_METHOD_ORDER_BUG_TEST_VCX_YValidarEl_BUG_DelOrdenDeMetodosDeClases_v1_19_29
LOCAL lnCodError, lnCodError_Esperado ;
, lc_File, lc_InputFile, lc_OutputFile, lcParent, lcClass, lcObjName, loReg_Esperado, loReg, lcTipoBinario, lcTXT0, lcTXT1 ;
, loModulo AS CL_CLASE OF "FOXBIN2PRG.PRG" ;
, loCnv AS c_foxbin2prg OF "FOXBIN2PRG.PRG" ;
, loEx AS EXCEPTION
#IF .F.
PUBLIC oFXU_LIB AS CL_FXU_CONFIG OF 'TESTS\fxu_lib_objetos_y_funciones_de_soporte.PRG'
#ENDIF
TRY
loEx = NULL
loCnv = NEWOBJECT("c_foxbin2prg", "FOXBIN2PRG.PRG")
*loCnv.l_Debug = .F.
loCnv.l_ShowErrors = .F.
*loCnv.l_Test = .T.
*loCnv.l_PropSort_Enabled = .F. && Para buscar diferencias
*loCnv.l_MethodSort_Enabled = .F. && Para buscar diferencias
*-- DATOS DE ENTRADA
STORE 0 TO lnCodError
lc_File = 'CLASSLIB_METHOD_ORDER_BUG_TEST.VCX'
lc_InputFile = FORCEPATH( lc_File, oFXU_LIB.cPathDatosReadOnly )
lc_OutputFile = FORCEPATH( lc_File, oFXU_LIB.cPathDatosTest )
lcTipoBinario = UPPER( JUSTEXT( lc_OutputFile ) )
oFXU_LIB.copiarArchivosParaTest( FORCEEXT( lc_File, LEFT( JUSTEXT(lc_File),2 ) + '?' ) )
loCnv.Convertir( lc_OutputFile, .F., .F., .T. )
*loCnv.Convertir( FORCEEXT(lc_OutputFile, LEFT( JUSTEXT(lc_File),2 ) + '2' ), .F., .F., .T. )
*-- Comparo resultados
lcTXT0 = FORCEPATH( FORCEEXT(lc_File,'VC2'), ADDBS( oFXU_LIB.cPathDatosReadOnly ) )
lcTXT1 = FORCEPATH( FORCEEXT(lc_File,'VC2'), ADDBS( oFXU_LIB.cPathDatosTest ) )
llEqual = ( FILETOSTR( lcTXT0 ) == FILETOSTR( lcTXT1 ) )
THIS.messageout( "Se comparan archivos VC2, para saber si hay cambios" )
THIS.messageout( "lcTXT0 = " + lcTXT0 )
THIS.messageout( "lcTXT1 = " + lcTXT1 )
THIS.asserttrue( llEqual, "COMPARACI<43>N DE VC2" )
CATCH TO loEx
THIS.Evaluate_results( loEx, lnCodError_Esperado, lc_OutputFile, lcParent, lcClass, lcObjName, loReg_Esperado )
FINALLY
USE IN (SELECT("ARCHIVOBIN_IN"))
USE IN (SELECT("TABLABIN"))
STORE NULL TO loModulo, loCnv
RELEASE loModulo, loCnv
ENDTRY
ENDFUNC
*******************************************************************************************************************************************
FUNCTION Deberia_Ejecutar_FOXBIN2PRG_ParaLaLibreria_FB2P_TEST_VCX_YValidarEl_BUG_Del_PROCEDURE_SIN_ENDPROC
LOCAL lnCodError, lnCodError_Esperado ;

View File

@@ -72,32 +72,36 @@ DEFINE CLASS ut__foxbin2prg__c_conversor_base__IdentificarBloquesDeExclusion as
*******************************************************************************************************************************************
FUNCTION Deberia_ObtenerLaUbicacionDelBloque_IF_ENDIF_CuandoCodigoCon_IF_ENDIF_predominante_esEvaluado
LOCAL lcMethod, laLineas(1), lnLineas, laPos(1,2), lnPos_Count, laExpected_Pos(2,2) ;
, laLineasExclusion(10), laLineasExclusion_Esperadas(10)
, laLineasExclusion(12), laLineasExclusion_Esperadas(12)
LOCAL loObj AS c_conversor_prg_a_bin OF "FOXBIN2PRG.PRG"
loObj = THIS.icObj
*-- Input and expected params
STORE '' TO lcMethod
laExpected_Pos(1,1) = 3
laExpected_Pos(1,2) = 5
laExpected_Pos(2,1) = 7
laExpected_Pos(2,2) = 9
laExpected_Pos(1,2) = 6
laExpected_Pos(2,1) = 8
laExpected_Pos(2,2) = 11
laLineasExclusion_Esperadas( 3) = .T.
laLineasExclusion_Esperadas( 4) = .T.
laLineasExclusion_Esperadas( 5) = .T.
laLineasExclusion_Esperadas( 7) = .T.
laLineasExclusion_Esperadas( 8) = .T.
laLineasExclusion_Esperadas( 9) = .T.
laLineasExclusion_Esperadas(10) = .T.
laLineasExclusion_Esperadas(11) = .T.
TEXT TO lcMethod NOSHOW TEXTMERGE FLAGS 1 PRETEXT 1+2+4
TEXT TO lcMethod NOSHOW TEXTMERGE FLAGS 1 PRETEXT 1+2
<<C_PROC>> myMethod_B
*-- Code Block
<<C_IF_F>>
<<C_TEXT>>
value ;
<<C_ENDIF>>
*-- Code Block
<<C_IF_F>>
<<C_ENDTEXT>>
value ,
<<C_ENDIF>>
<<C_ENDPROC>>
ENDTEXT
@@ -132,13 +136,13 @@ DEFINE CLASS ut__foxbin2prg__c_conversor_base__IdentificarBloquesDeExclusion as
laLineasExclusion_Esperadas( 8) = .T.
laLineasExclusion_Esperadas( 9) = .T.
TEXT TO lcMethod NOSHOW TEXTMERGE FLAGS 1 PRETEXT 1+2+4
TEXT TO lcMethod NOSHOW TEXTMERGE FLAGS 1 PRETEXT 1+2
<<C_PROC>> myMethod_B
*-- Code Block
<<C_IF_F>>
<<C_IF_F>>
<<C_TEXT>>
*-- Code Block
*-- Code Block ;
<<C_ENDTEXT>>
<<C_ENDIF>>
<<C_ENDIF>>
@@ -159,32 +163,36 @@ DEFINE CLASS ut__foxbin2prg__c_conversor_base__IdentificarBloquesDeExclusion as
*******************************************************************************************************************************************
FUNCTION Deberia_ObtenerLaUbicacionDelBloque_TEXT_ENDTEXT_CuandoCodigoCon_TEXT_ENDTEXT_predominante_esEvaluado
LOCAL lcMethod, laLineas(1), lnLineas, laPos(1,2), lnPos_Count, laExpected_Pos(2,2) ;
, laLineasExclusion(10), laLineasExclusion_Esperadas(10)
, laLineasExclusion(12), laLineasExclusion_Esperadas(12)
LOCAL loObj AS c_conversor_prg_a_bin OF "FOXBIN2PRG.PRG"
loObj = THIS.icObj
*-- Input and expected params
STORE '' TO lcMethod
laExpected_Pos(1,1) = 3
laExpected_Pos(1,2) = 5
laExpected_Pos(2,1) = 7
laExpected_Pos(2,2) = 9
laExpected_Pos(1,2) = 6
laExpected_Pos(2,1) = 8
laExpected_Pos(2,2) = 11
laLineasExclusion_Esperadas( 3) = .T.
laLineasExclusion_Esperadas( 4) = .T.
laLineasExclusion_Esperadas( 5) = .T.
laLineasExclusion_Esperadas( 7) = .T.
laLineasExclusion_Esperadas( 8) = .T.
laLineasExclusion_Esperadas( 9) = .T.
laLineasExclusion_Esperadas(10) = .T.
laLineasExclusion_Esperadas(11) = .T.
TEXT TO lcMethod NOSHOW TEXTMERGE FLAGS 1 PRETEXT 1+2+4
TEXT TO lcMethod NOSHOW TEXTMERGE FLAGS 1 PRETEXT 1+2
<<C_PROC>> myMethod_B
*-- Code Block
<<C_TEXT>>
<<C_IF_F>>
value ;
<<C_ENDTEXT>>
*-- Code Block
<<C_TEXT>>
<<C_ENDIF>>
value ,
<<C_ENDTEXT>>
<<C_ENDPROC>>
ENDTEXT
@@ -211,7 +219,7 @@ DEFINE CLASS ut__foxbin2prg__c_conversor_base__IdentificarBloquesDeExclusion as
laExpected_Pos(1,1) = 0
laExpected_Pos(1,2) = 0
TEXT TO lcMethod NOSHOW TEXTMERGE FLAGS 1 PRETEXT 1+2+4
TEXT TO lcMethod NOSHOW TEXTMERGE FLAGS 1 PRETEXT 1+2
<<C_PROC>> myMethod_B
*-- Code Block
IF !FOUND()
@@ -292,7 +300,7 @@ DEFINE CLASS ut__foxbin2prg__c_conversor_base__IdentificarBloquesDeExclusion as
laLineasExclusion_Esperadas(I) = .T.
ENDFOR
TEXT TO lcMethod NOSHOW TEXTMERGE FLAGS 1 PRETEXT 1+2+4
TEXT TO lcMethod NOSHOW TEXTMERGE FLAGS 1 PRETEXT 1+2
<<C_PROC>> myMethod_B
*-- Code Block
IF ODBC_Query.odbc
@@ -335,4 +343,56 @@ DEFINE CLASS ut__foxbin2prg__c_conversor_base__IdentificarBloquesDeExclusion as
ENDFUNC
*******************************************************************************************************************************************
FUNCTION Deberia_EncontrarBloque_TEXT_ENDTEXT_CuandoEvaluaUnaLineaQueTerminaConUn_EndText_YLineaAnteriorTerminaEn_Coma
LOCAL lcMethod, laLineas(1), lnLineas, laPos(1,2), lnPos_Count, laExpected_Pos(1,2) ;
, laLineasExclusion(23), laLineasExclusion_Esperadas(23)
LOCAL loObj AS c_conversor_prg_a_bin OF "FOXBIN2PRG.PRG"
loObj = THIS.icObj
*-- Input and expected params
STORE '' TO lcMethod
laExpected_Pos(1,1) = 3
laExpected_Pos(1,2) = 13
FOR I = 3 TO 13
laLineasExclusion_Esperadas(I) = .T.
ENDFOR
TEXT TO lcMethod NOSHOW TEXTMERGE FLAGS 1 PRETEXT 1+2
<<C_PROC>> Init
Local lcRowSource
<<C_TEXT>> To lcRowSource Textmerge Noshow
Overview,ItemDtl,
Forecasting,Forecasting,
Purchase Orders,PurchaseOrders,
Sales Orders,SalesOrders,
Sales History,History,
Inventory,Bins,
Inventory History,InventoryHistory,
Configuration,PartsInfo,
Operations,Operations,
<<C_ENDTEXT>>
This.RowSource = Chrtran(lcRowSource, CRLF, '')
This.ControlSource = 'Thisform.cStartPage'
This.Value = ReadSetting('Item Detail Start Page', 'ItemDtl', .F., .T.)
<<C_ENDPROC>>
<<C_PROC>> Valid
WriteSetting('Item Detail Start Page', This.Value, .F., .T.)
Thisform.comboPartno.SetFocus()
<<C_ENDPROC>>
ENDTEXT
lnLineas = ALINES( laLineas, lcMethod )
*-- Test
loObj.identificarBloquesDeExclusion( @laLineas, lnLineas, , @laLineasExclusion, @lnPos_Count, @laPos )
*-- Evaluaci<63>n de resultados
THIS.Evaluate_results( @laExpected_Pos, @laPos, lnPos_Count, @laLineasExclusion_Esperadas, @laLineasExclusion )
ENDFUNC
ENDDEFINE

Binary file not shown.

View File

@@ -23,10 +23,10 @@ _CompanyName = "Fernando D. Bozzo"
_FileDescription = "Conversor bidireccional de binarios FoxPro 9 (scx,vcx,pjx) a texto para sustituir al scctext :-)"
_LegalCopyright = "Creative Commons 4: Reconocimiento - CompartirIgual (by-sa): http://creativecommons.org/licenses/by/4.0/"
_LegalTrademark = "Creative Commons 4: Reconocimiento - CompartirIgual (by-sa): http://creativecommons.org/licenses/by/4.0/"
_ProductName = " FOXBIN2PRG v1.19.29"
_ProductName = " FOXBIN2PRG v1.19.30"
_MajorVer = "1"
_MinorVer = "19"
_Revision = "29"
_Revision = "30"
_LanguageID = "1034"
_AutoIncrement = "0"
*</DevInfo>
@@ -109,6 +109,7 @@ WITH loProject.FILES
.ADD('tests\ut__foxbin2prg__c_conversor_prg_a_bin__analizarasignacion_tag_indicado.prg') && *< FileMetadata: Type="P" Cpid="1252" Timestamp="0" ID="0" ObjRev="544" />
.ADD('tests\ut__foxbin2prg__c_conversor_prg_a_bin__insert_allobjects.prg') && *< FileMetadata: Type="P" Cpid="1252" Timestamp="0" ID="0" ObjRev="544" />
.ADD('tests\ut__foxbin2prg__c_foxbin2prg__evaluarconfiguracion.prg') && *< FileMetadata: Type="P" Cpid="1252" Timestamp="0" ID="0" ObjRev="544" />
.ADD('tests\ut__foxbin2prg__c_foxbin2prg__filenamefoundinfilter.prg') && *< FileMetadata: Type="P" Cpid="1252" Timestamp="0" ID="0" ObjRev="0" />
*</BuildProj>
.ITEM('__newproject.f2b').Remove()
@@ -137,6 +138,7 @@ WITH loProject.FILES
.ITEM(lcCurdir + 'tests\ut__foxbin2prg__c_conversor_prg_a_bin__analizarasignacion_tag_indicado.prg').Exclude = .T.
.ITEM(lcCurdir + 'tests\ut__foxbin2prg__c_conversor_prg_a_bin__insert_allobjects.prg').Exclude = .T.
.ITEM(lcCurdir + 'tests\ut__foxbin2prg__c_foxbin2prg__evaluarconfiguracion.prg').Exclude = .T.
.ITEM(lcCurdir + 'tests\ut__foxbin2prg__c_foxbin2prg__filenamefoundinfilter.prg').Exclude = .T.
*</ExcludedFiles>
*<TextFiles>

Binary file not shown.

Binary file not shown.

View File

@@ -96,6 +96,8 @@
* 02/06/2014 DH/FDBOZZO v1.19.27 Mejora: Agregado soporte para exportar datos para DIFF (no para importar)
* 21/07/2014 FDBOZZO v1.19.28 Mejora: Agregada funcionalidad para filtrado de tablas y datos cuando se elige DBF_Conversion_Support:4 (Edyshor)
* 29/07/2014 FDBOZZO v1.19.29 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
* 07/08/2014 FDBOZZO v1.19.30 Arreglo bug vcx/scx: Cuando la l<>nea anterior a un ENDTEXT termina en ";" o "," no se reconoce como ENDTEXT sino como continuaci<63>n (Jim Nelson)
* 08/08/2014 FDBOZZO v1.19.30 Arreglo bug vcx/vct v1.19.29: En ciertos casos de herencia no se mantiene el orden alfabetico de algunos metodos (Ryan Harris)
* </HISTORIAL DE CAMBIOS Y NOTAS IMPORTANTES>
*
*---------------------------------------------------------------------------------------------------
@@ -135,6 +137,8 @@
* 02/06/2014 Doug Hennig MEJORA v1.19.22: Agregada funcionalidad para exportar los datos de las tablas al archivo db2 (Agregado en v1.19.27)
* 21/07/2014 Edyshor PROPUESTA DE MEJORA db2 v1.19.27: Ser<65>a <20>til poder filtrar tablas y datos cuando se elige DBF_Conversion_Support:4 (Agregado en v1.19.28)
* 29/07/2014 M_N_M REPORTE BUG vcx/scx v1.19.28: Los campos de tabla con nombre "text" a veces provocan corrupci<63>n del binario generado (Arreglado en v1.19.29)
* 07/08/2014 Jim Nelson REPORTE BUG vcx/scx v1.19.29: Cuando la l<>nea anterior a un ENDTEXT termina en ";" o "," no se reconoce como ENDTEXT sino como continuaci<63>n (Arreglado en v1.19.30)
* 08/08/2014 Ryan Harris REPORTE BUG vcx/vct v1.19.29: En ciertos casos de herencia no se mantiene el orden alfabetico de algunos metodos (solucionado en v1.19.30)
* </TESTEO Y REPORTE DE BUGS (AGRADECIMIENTOS)>
*
*---------------------------------------------------------------------------------------------------
@@ -1129,9 +1133,9 @@ DEFINE CLASS c_foxbin2prg AS CUSTOM
IF .l_AllowMultiConfig AND .l_ConfigEvaluated AND .l_Main_CFG_Loaded
lo_CFG = CREATEOBJECT('CL_CFG')
lo_Configuration.Add( lo_CFG, lc_CFG_Path )
lo_Configuration.Add( lo_CFG, lc_CFG_Path )
ELSE
lo_Configuration.Add( NULL, lc_CFG_Path )
lo_Configuration.Add( NULL, lc_CFG_Path )
ENDIF
FOR I = 1 TO ALINES( laConfig, FILETOSTR( lcConfigFile ), 1+4 )
@@ -1288,8 +1292,8 @@ DEFINE CLASS c_foxbin2prg AS CUSTOM
ENDCASE
ENDFOR
IF .l_AllowMultiConfig AND .l_Main_CFG_Loaded AND lo_Configuration.Count > 0
.n_CFG_Actual = lo_Configuration.Count &&lo_Configuration.GetKey( UPPER( JUSTPATH( lcConfigFile ) ) )
IF .l_AllowMultiConfig AND .l_Main_CFG_Loaded AND lo_Configuration.Count > 0
.n_CFG_Actual = lo_Configuration.Count &&lo_Configuration.GetKey( UPPER( JUSTPATH( lcConfigFile ) ) )
ENDIF
ENDIF && llExisteConfig
@@ -1376,18 +1380,18 @@ DEFINE CLASS c_foxbin2prg AS CUSTOM
* tcFilename (v! IN ) Nombre del archivo a evaluar
* tcFilters (v! IN ) Filtros a evaluar (*,??E.*,R*.*)
*---------------------------------------------------------------------------------------------------
LPARAMETERS tcFilename, tcFilters
LPARAMETERS tcFileName, tcFilters
LOCAL llFound, laFiltros(1)
tcFilename = UPPER(tcFilename)
tcFileName = UPPER(tcFileName)
FOR I = 1 TO ALINES( laFiltros, tcFilters + ',', 1+4, ',' )
IF LIKE( UPPER(laFiltros(I)), tcFilename )
IF LIKE( UPPER(laFiltros(I)), tcFileName )
llFound = .T.
EXIT
ENDIF
ENDFOR
RETURN llFound
ENDFUNC
@@ -2716,8 +2720,8 @@ DEFINE CLASS c_conversor_base AS SESSION
RETURN llEncontrado
ENDPROC
PROCEDURE decode_SpecialCodes_1_31
*---------------------------------------------------------------------------------------------------
* PAR<41>METROS: (v=Pasar por valor | @=Pasar por referencia) (!=Obligatorio | ?=Opcional) (IN/OUT)
@@ -3033,7 +3037,7 @@ DEFINE CLASS c_conversor_base AS SESSION
* tcAsignacion (v! IN ) Asignaci<63>n completa con variable, igualdad y valor
* tcPropName (@! OUT) Nombre de la variable
* tcValue (@? OUT) Valor
* toClase (v! IN )
* toClase (v! IN )
* taCodeLines (@! IN ) L<>neas de c<>digo a analizar
* tnCodeLines (v! IN ) Cantidad de l<>neas de c<>digo
* I (@! IN/OUT) L<>nea actual
@@ -3164,10 +3168,11 @@ DEFINE CLASS c_conversor_base AS SESSION
DO CASE
CASE .elTextoEvaluadoEsElTokenIndicado( @lcLine, @ta_ID_Bloques, lnLen_IDFinBQ, X, 1 ) ;
AND NOT THIS.currentLineIsPreviousLineContinuation( @taCodeLines, I )
*-- Busca el primer marcador (#IF o TEXT)
lnAnidamientos = lnAnidamientos + 1
CASE .elTextoEvaluadoEsElTokenIndicado( @lcLine, @ta_ID_Bloques, lnLen_IDFinBQ, X, 2 ) ;
AND NOT THIS.currentLineIsPreviousLineContinuation( @taCodeLines, I )
CASE .elTextoEvaluadoEsElTokenIndicado( @lcLine, @ta_ID_Bloques, lnLen_IDFinBQ, X, 2 )
*-- Busca el segundo marcador (#ENDIF o ENDTEXT)
lnAnidamientos = lnAnidamientos - 1
IF lnAnidamientos = 0
@@ -4615,11 +4620,11 @@ DEFINE CLASS c_conversor_prg_a_bin AS c_conversor_base
lcPropsMemo = .objectProps2Memo( toObjeto, toClase )
lcMethodsMemo = .objectMethods2Memo( toObjeto, toClase )
IF EMPTY(toObjeto._TIMESTAMP)
toObjeto._TIMESTAMP = THIS.RowTimeStamp(DATETIME())
IF EMPTY(toObjeto._TimeStamp)
toObjeto._TimeStamp = THIS.RowTimeStamp(DATETIME())
ENDIF
IF EMPTY(toObjeto._UNIQUEID)
toObjeto._UNIQUEID = SYS(2015)
IF EMPTY(toObjeto._UniqueID)
toObjeto._UniqueID = SYS(2015)
ENDIF
*-- Inserto el objeto
@@ -4700,11 +4705,11 @@ DEFINE CLASS c_conversor_prg_a_bin AS c_conversor_base
FOR X = 1 TO toClase._AddObject_Count
loObjeto = toClase._AddObjects( X )
IF EMPTY(loObjeto._TIMESTAMP)
loObjeto._TIMESTAMP = THIS.RowTimeStamp(DATETIME())
IF EMPTY(loObjeto._TimeStamp)
loObjeto._TimeStamp = THIS.RowTimeStamp(DATETIME())
ENDIF
IF EMPTY(loObjeto._UNIQUEID)
loObjeto._UNIQUEID = SYS(2015)
IF EMPTY(loObjeto._UniqueID)
loObjeto._UniqueID = SYS(2015)
ENDIF
laObjNames( X, 1 ) = loObjeto._Nombre
@@ -5872,11 +5877,11 @@ DEFINE CLASS c_conversor_prg_a_vcx AS c_conversor_prg_a_bin
LOOP
ENDIF
IF EMPTY(loClase._TIMESTAMP)
loClase._TIMESTAMP = THIS.RowTimeStamp(DATETIME())
IF EMPTY(loClase._TimeStamp)
loClase._TimeStamp = THIS.RowTimeStamp(DATETIME())
ENDIF
IF EMPTY(loClase._UNIQUEID)
loClase._UNIQUEID = SYS(2015)
IF EMPTY(loClase._UniqueID)
loClase._UniqueID = SYS(2015)
ENDIF
*-- Inserto la clase
@@ -6175,11 +6180,11 @@ DEFINE CLASS c_conversor_prg_a_scx AS c_conversor_prg_a_bin
LOOP
ENDIF
IF EMPTY(loClase._TIMESTAMP)
loClase._TIMESTAMP = THIS.RowTimeStamp(DATETIME())
IF EMPTY(loClase._TimeStamp)
loClase._TimeStamp = THIS.RowTimeStamp(DATETIME())
ENDIF
IF EMPTY(loClase._UNIQUEID)
loClase._UNIQUEID = SYS(2015)
IF EMPTY(loClase._UniqueID)
loClase._UniqueID = SYS(2015)
ENDIF
*-- Inserto la clase
@@ -6414,8 +6419,8 @@ DEFINE CLASS c_conversor_prg_a_pjx AS c_conversor_prg_a_bin
lcMainProg = LOWER( SYS(2014, toProject._MainProg, ADDBS(toProject._HomeDir) ) )
ENDIF
IF EMPTY(toProject._TIMESTAMP)
toProject._TIMESTAMP = THIS.RowTimeStamp(DATETIME())
IF EMPTY(toProject._TimeStamp)
toProject._TimeStamp = THIS.RowTimeStamp(DATETIME())
ENDIF
IF EMPTY(toProject._ID)
toProject._ID = INT(VAL(SYS(3)))
@@ -6454,8 +6459,8 @@ DEFINE CLASS c_conversor_prg_a_pjx AS c_conversor_prg_a_bin
*-- Agrego los ARCHIVOS
FOR EACH loFile IN toProject FOXOBJECT
IF EMPTY(loFile._TIMESTAMP)
loFile._TIMESTAMP = THIS.RowTimeStamp(DATETIME())
IF EMPTY(loFile._TimeStamp)
loFile._TimeStamp = THIS.RowTimeStamp(DATETIME())
ENDIF
IF EMPTY(loFile._ID)
loFile._ID = INT(VAL(SYS(3)))
@@ -8167,12 +8172,14 @@ DEFINE CLASS c_conversor_bin_a_prg AS c_conversor_base
+ [<memberdata name="convertir" display="Convertir"/>] ;
+ [<memberdata name="exception2str" display="Exception2Str"/>] ;
+ [<memberdata name="get_add_object_methods" display="get_ADD_OBJECT_METHODS"/>] ;
+ [<memberdata name="get_class_methods" display="get_CLASS_METHODS"/>] ;
+ [<memberdata name="get_nombresobjetosolepublic" display="get_NombresObjetosOLEPublic"/>] ;
+ [<memberdata name="get_propsfrom_protected" display="get_PropsFrom_PROTECTED"/>] ;
+ [<memberdata name="get_propsandcommentsfrom_reserved3" display="get_PropsAndCommentsFrom_RESERVED3"/>] ;
+ [<memberdata name="get_propsandvaluesfrom_properties" display="get_PropsAndValuesFrom_PROPERTIES"/>] ;
+ [<memberdata name="indentarmemo" display="IndentarMemo"/>] ;
+ [<memberdata name="memoinoneline" display="MemoInOneLine"/>] ;
+ [<memberdata name="method2array" display="Method2Array"/>] ;
+ [<memberdata name="normalizarasignacion" display="normalizarAsignacion"/>] ;
+ [<memberdata name="set_multilinememowithaddobjectproperties" display="set_MultilineMemoWithAddObjectProperties"/>] ;
+ [<memberdata name="sortmethod" display="SortMethod"/>] ;
@@ -8180,7 +8187,6 @@ DEFINE CLASS c_conversor_bin_a_prg AS c_conversor_base
+ [<memberdata name="write_all_object_methods" display="write_ALL_OBJECT_METHODS"/>] ;
+ [<memberdata name="write_cabecera_reporte" display="write_CABECERA_REPORTE"/>] ;
+ [<memberdata name="write_classmetadata" display="write_CLASSMETADATA"/>] ;
+ [<memberdata name="write_class_methods" display="write_CLASS_METHODS"/>] ;
+ [<memberdata name="write_class_properties" display="write_CLASS_PROPERTIES"/>] ;
+ [<memberdata name="write_dataenvironment_reporte" display="write_DATAENVIRONMENT_REPORTE"/>] ;
+ [<memberdata name="write_dbc_header" display="write_DBC_HEADER"/>] ;
@@ -8236,17 +8242,18 @@ DEFINE CLASS c_conversor_bin_a_prg AS c_conversor_base
#ENDIF
TRY
LOCAL lcMethodName
LOCAL lcMethodName, lnMethodCount
WITH THIS AS c_conversor_bin_a_prg OF 'FOXBIN2PRG.PRG'
.SortMethod( toRegObj.METHODS, @taMethods, @taCode, '', @tnMethodCount ;
lnMethodCount = tnMethodCount
.Method2Array( toRegObj.METHODS, @taMethods, @taCode, '', @tnMethodCount ;
, @taPropsAndComments, tnPropsAndComments_Count, @taProtected, tnProtected_Count, @toFoxBin2Prg )
*-- Ubico los m<>todos protegidos y les cambio la definici<63>n.
*-- Los m<>todos se deben generar con la ruta completa, porque si no es imposible saber a que objeto corresponden,
*-- o si son de la clase.
IF tnMethodCount > 0 THEN
FOR I = 1 TO tnMethodCount
IF tnMethodCount - lnMethodCount > 0 THEN
FOR I = lnMethodCount + 1 TO tnMethodCount
IF taMethods(I,2) = 0
LOOP
ENDIF
@@ -8268,10 +8275,8 @@ DEFINE CLASS c_conversor_bin_a_prg AS c_conversor_base
ENDIF
*-- Genero el m<>todo SIN indentar, ya que se hace luego
*-- Sustituyo el TEXT/ENDTEXT aqu<71> porque a veces quita espacios de la derecha, y eso es peligroso
tcMethods = tcMethods + CR_LF + 'PROCEDURE ' + lcMethodName
tcMethods = tcMethods + CR_LF + .IndentarMemo( taCode(taMethods(I,2)) )
tcMethods = tcMethods + CR_LF + 'ENDPROC'
taCode(taMethods(I,2)) = 'PROCEDURE ' + lcMethodName + CR_LF + .IndentarMemo( taCode(taMethods(I,2)) ) + CR_LF + 'ENDPROC'
taMethods(I,1) = lcMethodName
ENDFOR
ENDIF
ENDWITH && THIS
@@ -8288,6 +8293,73 @@ DEFINE CLASS c_conversor_bin_a_prg AS c_conversor_base
ENDPROC
*******************************************************************************************************************
PROCEDURE get_CLASS_METHODS
LPARAMETERS tnMethodCount, taMethods, taCode, taProtected, taPropsAndComments
*-- DEFINIR M<>TODOS DE LA CLASE
*-- Ubico los m<>todos protegidos y les cambio la definici<63>n
EXTERNAL ARRAY taMethods, taCode, taProtected, taPropsAndComments
TRY
LOCAL lcMethod, lcMethodName, lnProtectedItem, lnCommentRow, lcProcDef, lcMethods, lnLen
STORE '' TO lcMethod, lcMethodName, lcProcDef, lcMethods
IF tnMethodCount > 0 THEN
WITH THIS AS c_conversor_bin_a_prg OF 'FOXBIN2PRG.PRG'
FOR I = 1 TO tnMethodCount
lcMethodName = CHRTRAN( taMethods(I,1), '^', '' )
lnProtectedItem = ASCAN( taProtected, taMethods(I,1), 1, 0, 0, 1+2+4)
IF lnProtectedItem = 0
lnProtectedItem = ASCAN( taProtected, taMethods(I,1) + '^', 1, 0, 0, 1+2+4)
IF lnProtectedItem = 0
*-- M<>todo com<6F>n
lcProcDef = 'PROCEDURE'
ELSE
*-- M<>todo oculto
lcProcDef = 'HIDDEN PROCEDURE'
ENDIF
ELSE
*-- M<>todo protegido
lcProcDef = 'PROTECTED PROCEDURE'
ENDIF
lnCommentRow = ASCAN( taPropsAndComments, '*' + lcMethodName, 1, 0, 1, 1+2+4+8)
*-- Nombre del m<>todo
lcMethod = lcProcDef + ' ' + taMethods(I,1)
*-- Comentarios del m<>todo (si tiene)
IF lnCommentRow > 0 AND NOT EMPTY(taPropsAndComments(lnCommentRow,2))
lcMethod = lcMethod + C_TAB + C_TAB + '&' + '& ' + taPropsAndComments(lnCommentRow,2)
ENDIF
*-- C<>digo del m<>todo
IF taMethods(I,2) > 0 THEN
taCode(taMethods(I,2)) = lcMethod + CR_LF + .IndentarMemo( taCode(taMethods(I,2)) ) + CR_LF + 'ENDPROC'
ELSE
lnLen = ALEN(taCode,1) + 1
DIMENSION taCode( lnLen )
taCode( lnLen ) = lcMethod + CR_LF + 'ENDPROC'
taMethods(I,2) = lnLen
ENDIF
ENDFOR
ENDWITH && THIS
ENDIF
CATCH TO loEx
IF THIS.l_Debug AND _VFP.STARTMODE = 0
SET STEP ON
ENDIF
THROW
ENDTRY
RETURN
ENDPROC
*******************************************************************************************************************
PROCEDURE get_NombresObjetosOLEPublic
LPARAMETERS ta_NombresObjsOle
@@ -8498,7 +8570,7 @@ DEFINE CLASS c_conversor_bin_a_prg AS c_conversor_base
tnProtected_Count = tnProtected_Count - 1
ENDIF
ENDFOR
DIMENSION taProtected(tnProtected_Count)
ENDIF
@@ -8508,16 +8580,18 @@ DEFINE CLASS c_conversor_bin_a_prg AS c_conversor_base
*******************************************************************************************************************
PROCEDURE IndentarMemo
LPARAMETERS tcMethod, tcIndentation
LPARAMETERS tcMethod, tcIndentation, tlKeepProcHeader
*-- INDENTA EL C<>DIGO DE UN M<>TODO DADO Y QUITA LA CABECERA DE M<>TODO (PROCEDURE/ENDPROC) SI LA ENCUENTRA
TRY
LOCAL I, X, lcMethod, llProcedure, lnInicio, lnFin, laLineas(1)
LOCAL I, X, lcMethod, llProcedure, lnInicio, lnFin, laLineas(1), lnOffset
lcMethod = ''
llProcedure = ( LEFT(tcMethod,10) == 'PROCEDURE ' ;
OR LEFT(tcMethod,17) == 'HIDDEN PROCEDURE ' ;
OR LEFT(tcMethod,20) == 'PROTECTED PROCEDURE ' )
lnInicio = 1
lnOffset = 0
lnFin = ALINES(laLineas, tcMethod)
llProcedure = ( LEFT(laLineas(1),10) == 'PROCEDURE ' ;
OR LEFT(laLineas(1),17) == 'HIDDEN PROCEDURE ' ;
OR LEFT(laLineas(1),20) == 'PROTECTED PROCEDURE ' )
IF VARTYPE(tcIndentation) # 'C'
tcIndentation = ''
ENDIF
@@ -8543,15 +8617,20 @@ DEFINE CLASS c_conversor_bin_a_prg AS c_conversor_base
*-- Si encuentra la cabecera de un PROCEDURE, la saltea
IF llProcedure
lnInicio = 2
lnFin = lnFin - 1
lnOffset = 1
ENDIF
FOR I = lnInicio TO lnFin
FOR I = lnInicio + lnOffset TO lnFin - lnOffset
*-- TEXT/ENDTEXT aqu<71> da error 2044 de recursividad. No usar.
lcMethod = lcMethod + CR_LF + tcIndentation + laLineas(I)
ENDFOR
IF llProcedure AND tlKeepProcHeader
laLineas(lnInicio) = C_TAB + laLineas(lnInicio)
laLineas(lnFin) = C_TAB + laLineas(lnFin)
lcMethod = CR_LF + laLineas(lnInicio) + lcMethod + CR_LF + laLineas(lnFin)
ENDIF
lcMethod = SUBSTR(lcMethod,3) && Quito el primer ENTER (CR+LF)
CATCH TO loEx
@@ -8629,6 +8708,69 @@ DEFINE CLASS c_conversor_bin_a_prg AS c_conversor_base
*******************************************************************************************************************
PROCEDURE SortMethod
LPARAMETERS tcMethod, taMethods, taCode, tcSorted, tnMethodCount, taPropsAndComments, tnPropsAndComments_Count ;
, taProtected, tnProtected_Count, toFoxBin2Prg
EXTERNAL ARRAY taMethods, taCode, taPropsAndComments, taProtected
#IF .F.
LOCAL toFoxBin2Prg AS c_foxbin2prg OF 'FOXBIN2PRG.PRG'
#ENDIF
TRY
LOCAL I, I2, laMethods(1,3), lnDeleted, lcMethodName, lnMethodPos, lcMethodType, loEx AS EXCEPTION
IF tnMethodCount > 0 THEN
*-- taMethods[1,3]
*-- 1.Nombre M<>todo
*-- 2.Posici<63>n Original
*-- 3.Tipo (HIDDEN/PROTECTED/NORMAL)
*-- Alphabetical ordering of methods
IF THIS.l_MethodSort_Enabled
ASORT(taMethods,1,-1,0,1)
ENDIF
DIMENSION laMethods(tnMethodCount,3)
lnDeleted = 0
FOR I = tnMethodCount TO 1 STEP -1
IF taMethods(I,2) > 0 THEN
IF '.' $ taMethods(I,1)
*-- Los m<>todos con '.' los mando a otro array
lnDeleted = lnDeleted + 1
laMethods(lnDeleted,1) = taMethods(I,1)
laMethods(lnDeleted,2) = taMethods(I,2)
laMethods(lnDeleted,3) = taMethods(I,3)
ADEL( taMethods, I )
ENDIF
ENDIF
ENDFOR
FOR I = lnDeleted TO 1 STEP -1
*-- Los m<>todos con '.' los paso al final
I2 = tnMethodCount - lnDeleted + (lnDeleted - I) + 1
taMethods(I2,1) = laMethods(I,1)
taMethods(I2,2) = laMethods(I,2)
taMethods(I2,3) = laMethods(I,3)
ENDFOR
ENDIF
CATCH TO loEx
IF THIS.l_Debug AND _VFP.STARTMODE = 0
SET STEP ON
ENDIF
THROW
ENDTRY
RETURN
ENDPROC && SordMethod
*******************************************************************************************************************
PROCEDURE Method2Array
LPARAMETERS tcMethod, taMethods, taCode, tcSorted, tnMethodCount, taPropsAndComments, tnPropsAndComments_Count ;
, taProtected, tnProtected_Count, toFoxBin2Prg
*-- 29/10/2013 Fernando D. Bozzo
@@ -8641,27 +8783,24 @@ DEFINE CLASS c_conversor_bin_a_prg AS c_conversor_base
*-- ESTRUCTURA DE LOS ARRAYS CREADOS:
*-- taMethods[1,3]
*-- Nombre M<>todo
*-- Posici<63>n Original
*-- Tipo (HIDDEN/PROTECTED/NORMAL)
*-- 1.Nombre M<>todo
*-- 2.Posici<EFBFBD>n Original
*-- 3.Tipo (HIDDEN/PROTECTED/NORMAL)
*-- taCode[1]
*-- Bloque de c<>digo del m<>todo en su posici<63>n original
*-- 1.Bloque de c<>digo del m<>todo en su posici<63>n original
TRY
LOCAL lnLineCount, laLine(1), I, lnTextNodes, tcSorted, lnProtectedLine, lcMethod, lnLine_Len, lcLine, llProcOpen ;
, laLineasExclusion(1), lnBloquesExclusion ;
, loEx AS EXCEPTION
DIMENSION taMethods(1,3)
STORE '' TO taMethods, tcSorted, taCode
tnMethodCount = 0
IF NOT EMPTY(m.tcMethod) AND LEFT(m.tcMethod,9) == "ENDPROC"+CHR(13)+CHR(10)
tcMethod = SUBSTR(m.tcMethod,10)
ENDIF
IF NOT EMPTY(m.tcMethod)
DIMENSION laLine(1), taMethods(1,3)
STORE '' TO laLine, taMethods, taCode
STORE 0 TO tnMethodCount, lnTextNodes
DIMENSION laLine(1)
STORE '' TO laLine
STORE 0 TO lnTextNodes
lnLineCount = ALINES(laLine, m.tcMethod) && NO aplicar nung<6E>n formato ni limpieza, que es el C<>DIGO FUENTE
@@ -8696,7 +8835,7 @@ DEFINE CLASS c_conversor_bin_a_prg AS c_conversor_base
*-- Identifico los TEXT/ENDTEXT, #IF .F./#ENDIF
THIS.identificarBloquesDeExclusion( @laLine, lnLineCount, .F., @laLineasExclusion, @lnBloquesExclusion )
*-- Analyze and count line methods, get method names and consolidate block code
FOR I = 1 TO lnLineCount
IF toFoxBin2Prg.l_DropNullCharsFromCode
@@ -8708,7 +8847,7 @@ DEFINE CLASS c_conversor_bin_a_prg AS c_conversor_base
DO CASE
CASE laLineasExclusion(I)
taCode(tnMethodCount) = taCode(tnMethodCount) + laLine(I) + CR_LF
CASE lnTextNodes = 0 AND UPPER( LEFT(laLine(I), 10) ) == 'PROCEDURE '
tnMethodCount = tnMethodCount + 1
DIMENSION taMethods(tnMethodCount, 3), taCode(tnMethodCount)
@@ -8746,7 +8885,7 @@ DEFINE CLASS c_conversor_bin_a_prg AS c_conversor_base
LOOP
ENDIF
taCode(tnMethodCount) = taCode(tnMethodCount) + laLine(I) + CR_LF
taCode(tnMethodCount) = taCode(tnMethodCount) + laLine(I) &&+ CR_LF
llProcOpen = .F.
CASE tnMethodCount = 0 OR NOT llProcOpen AND LEFT( LTRIM(laLine(I)),1 ) = '*'
@@ -8787,18 +8926,6 @@ DEFINE CLASS c_conversor_bin_a_prg AS c_conversor_base
ENDIF
ENDIF
ENDFOR
*-- Alphabetical ordering of methods
IF THIS.l_MethodSort_Enabled
ASORT(taMethods,1,-1,0,1)
ENDIF
FOR I = 1 TO tnMethodCount
IF taMethods(I,2) > 0 THEN
m.tcSorted = m.tcSorted + taCode(taMethods(I,2))
ENDIF
ENDFOR
ENDIF
CATCH TO loEx
@@ -8810,7 +8937,7 @@ DEFINE CLASS c_conversor_bin_a_prg AS c_conversor_base
ENDTRY
RETURN
ENDPROC && SordMethod
ENDPROC && Method2Array
*******************************************************************************************************************
@@ -8891,29 +9018,29 @@ DEFINE CLASS c_conversor_bin_a_prg AS c_conversor_base
*******************************************************************************************************************
PROCEDURE write_ALL_OBJECT_METHODS
LPARAMETERS tcMethods, taPropsAndComments, tnPropsAndComments_Count, taProtected, tnProtected_Count, toFoxBin2Prg
LPARAMETERS tcMethods, taMethods, taCode, tnMethodCount, taPropsAndComments, tnPropsAndComments_Count, taProtected, tnProtected_Count, toFoxBin2Prg
*-- Finalmente, todos los m<>todos los ordeno y escribo juntos
LOCAL laMethods(1), laCode(1), lnMethodCount, I, lcMethods
IF NOT EMPTY(tcMethods)
IF tnMethodCount > 0 THEN
STORE '' TO lcMethods
DIMENSION laMethods(1,3)
WITH THIS AS c_conversor_bin_a_prg OF 'FOXBIN2PRG.PRG'
.SortMethod( @tcMethods, @laMethods, @laCode, '', @lnMethodCount ;
.SortMethod( @tcMethods, @taMethods, @taCode, '', @tnMethodCount ;
, @taPropsAndComments, tnPropsAndComments_Count, @taProtected, tnProtected_Count, @toFoxBin2Prg )
FOR I = 1 TO lnMethodCount
lcMethods = C_TAB
FOR I = 1 TO tnMethodCount
*-- Genero los m<>todos indentados
*-- Sustituyo el TEXT/ENDTEXT aqu<71> porque a veces quita espacios de la derecha, y eso es peligroso
IF laMethods(I,2) = 0
IF taMethods(I,2) = 0
LOOP
ENDIF
lcMethods = lcMethods + CR_LF + C_TAB + laMethods(I,3) + C_PROCEDURE + ' ' + laMethods(I,1)
lcMethods = lcMethods + CR_LF + .IndentarMemo( laCode(laMethods(I,2)), CHR(9) + CHR(9) )
lcMethods = lcMethods + CR_LF + C_TAB + C_ENDPROC
lcMethods = lcMethods + CR_LF + .IndentarMemo( taCode(taMethods(I,2)), CHR(9) + CHR(9), .T. )
lcMethods = lcMethods + CR_LF
ENDFOR
ENDWITH && THIS
@@ -8925,79 +9052,6 @@ DEFINE CLASS c_conversor_bin_a_prg AS c_conversor_base
ENDPROC
*******************************************************************************************************************
PROCEDURE write_CLASS_METHODS
LPARAMETERS tnMethodCount, taMethods, taCode, taProtected, taPropsAndComments
*-- DEFINIR M<>TODOS DE LA CLASE
*-- Ubico los m<>todos protegidos y les cambio la definici<63>n
EXTERNAL ARRAY taMethods, taCode, taProtected, taPropsAndComments
TRY
LOCAL lcMethod, lnProtectedItem, lnCommentRow, lcProcDef, lcMethods
STORE '' TO lcMethod, lcProcDef, lcMethods
IF tnMethodCount > 0 THEN
WITH THIS AS c_conversor_bin_a_prg OF 'FOXBIN2PRG.PRG'
FOR I = 1 TO tnMethodCount
lcMethod = CHRTRAN( taMethods(I,1), '^', '' )
lnProtectedItem = ASCAN( taProtected, taMethods(I,1), 1, 0, 0, 1+2+4)
IF lnProtectedItem = 0
lnProtectedItem = ASCAN( taProtected, taMethods(I,1) + '^', 1, 0, 0, 1+2+4)
IF lnProtectedItem = 0
*-- M<>todo com<6F>n
lcProcDef = 'PROCEDURE'
ELSE
*-- M<>todo oculto
lcProcDef = 'HIDDEN PROCEDURE'
ENDIF
ELSE
*-- M<>todo protegido
lcProcDef = 'PROTECTED PROCEDURE'
ENDIF
lnCommentRow = ASCAN( taPropsAndComments, '*' + lcMethod, 1, 0, 1, 1+2+4+8)
*-- Nombre del m<>todo
TEXT TO lcMethods ADDITIVE TEXTMERGE NOSHOW FLAGS 1+2 PRETEXT 1+2
<<>> <<lcProcDef>> <<taMethods(I,1)>>
ENDTEXT
*-- Comentarios del m<>todo (si tiene)
IF lnCommentRow > 0 AND NOT EMPTY(taPropsAndComments(lnCommentRow,2))
TEXT TO lcMethods ADDITIVE TEXTMERGE NOSHOW FLAGS 1 PRETEXT 1+2
<<>> && <<taPropsAndComments(lnCommentRow,2)>>
ENDTEXT
ENDIF
*-- C<>digo del m<>todo
*-- Sustituyo el TEXT/ENDTEXT aqu<71> porque a veces quita espacios de la derecha, y eso es peligroso
IF taMethods(I,2) > 0 THEN
lcMethods = lcMethods + CR_LF + .IndentarMemo( taCode(taMethods(I,2)), C_TAB + C_TAB )
ENDIF
lcMethods = lcMethods + CR_LF + C_TAB + 'ENDPROC'
lcMethods = lcMethods + CR_LF
ENDFOR
ENDWITH && THIS
C_FB2PRG_CODE = C_FB2PRG_CODE + C_TAB + lcMethods &&+ CR_LF
ENDIF
CATCH TO loEx
IF THIS.l_Debug AND _VFP.STARTMODE = 0
SET STEP ON
ENDIF
THROW
ENDTRY
RETURN
ENDPROC
*******************************************************************************************************************
PROCEDURE write_CLASS_PROPERTIES
LPARAMETERS toRegClass, taPropsAndValues, taPropsAndComments, taProtected ;
@@ -9886,6 +9940,10 @@ DEFINE CLASS c_conversor_vcx_a_prg AS c_conversor_bin_a_prg
SCAN ALL FOR TABLABIN.PLATFORM = "WINDOWS" AND TABLABIN.RESERVED1=="Class"
STORE 0 TO lnMethodCount
STORE '' TO laMethods, laCode
loRegClass = NULL
SCATTER MEMO NAME loRegClass
IF toFoxBin2Prg.l_NoTimestamps
@@ -9961,12 +10019,14 @@ DEFINE CLASS c_conversor_vcx_a_prg AS c_conversor_bin_a_prg
*-- OBTENGO LOS M<>TODOS DE LA CLASE PARA POSTERIOR TRATAMIENTO
DIMENSION laMethods(1,3)
laMethods = ''
.SortMethod( loRegClass.METHODS, @laMethods, @laCode, '', @lnMethodCount ;
DIMENSION laMethods(1,3), laCode(1)
STORE '' TO laMethods, laCode
lnMethodCount = 0
.Method2Array( loRegClass.METHODS, @laMethods, @laCode, '', @lnMethodCount ;
, @laPropsAndComments, lnPropsAndComments_Count, @laProtected, lnProtected_Count, @toFoxBin2Prg )
.write_CLASS_METHODS( @lnMethodCount, @laMethods, @laCode, @laProtected, @laPropsAndComments )
.get_CLASS_METHODS( @lnMethodCount, @laMethods, @laCode, @laProtected, @laPropsAndComments )
lnLastClass = 1
lcMethods = ''
@@ -9995,7 +10055,7 @@ DEFINE CLASS c_conversor_vcx_a_prg AS c_conversor_bin_a_prg
, @laPropsAndComments, lnPropsAndComments_Count, @laProtected, lnProtected_Count, @toFoxBin2Prg )
ENDSCAN
.write_ALL_OBJECT_METHODS( @lcMethods, @laPropsAndComments, lnPropsAndComments_Count, @laProtected ;
.write_ALL_OBJECT_METHODS( @lcMethods, @laMethods, @laCode, @lnMethodCount, @laPropsAndComments, lnPropsAndComments_Count, @laProtected ;
, lnProtected_Count, @toFoxBin2Prg )
GOTO RECORD (lnRecno)
@@ -10122,6 +10182,9 @@ DEFINE CLASS c_conversor_scx_a_prg AS c_conversor_bin_a_prg
AND (EMPTY(TABLABIN.PARENT) ;
AND (TABLABIN.BASECLASS == 'dataenvironment' OR TABLABIN.BASECLASS == 'form' OR TABLABIN.BASECLASS == 'formset' ) )
STORE 0 TO lnMethodCount
STORE '' TO laMethods, laCode
loRegClass = NULL
SCATTER MEMO NAME loRegClass
@@ -10199,12 +10262,14 @@ DEFINE CLASS c_conversor_scx_a_prg AS c_conversor_bin_a_prg
*-- OBTENGO LOS M<>TODOS DE LA CLASE PARA POSTERIOR TRATAMIENTO
DIMENSION laMethods(1,3)
laMethods = ''
.SortMethod( loRegClass.METHODS, @laMethods, @laCode, '', @lnMethodCount ;
DIMENSION laMethods(1,3), laCode(1)
STORE '' TO laMethods, laCode
lnMethodCount = 0
.Method2Array( loRegClass.METHODS, @laMethods, @laCode, '', @lnMethodCount ;
, @laPropsAndComments, lnPropsAndComments_Count, @laProtected, lnProtected_Count, @toFoxBin2Prg )
.write_CLASS_METHODS( @lnMethodCount, @laMethods, @laCode, @laProtected, @laPropsAndComments )
.get_CLASS_METHODS( @lnMethodCount, @laMethods, @laCode, @laProtected, @laPropsAndComments )
lnLastClass = 1
lcMethods = ''
@@ -10235,7 +10300,7 @@ DEFINE CLASS c_conversor_scx_a_prg AS c_conversor_bin_a_prg
, @laPropsAndComments, lnPropsAndComments_Count, @laProtected, lnProtected_Count, @toFoxBin2Prg )
ENDSCAN
.write_ALL_OBJECT_METHODS( @lcMethods, @laPropsAndComments, lnPropsAndComments_Count, @laProtected ;
.write_ALL_OBJECT_METHODS( @lcMethods, @laMethods, @laCode, @lnMethodCount, @laPropsAndComments, lnPropsAndComments_Count, @laProtected ;
, lnProtected_Count, @toFoxBin2Prg )
GOTO RECORD (lnRecno)
@@ -11220,7 +11285,7 @@ DEFINE CLASS c_conversor_dbf_a_prg AS c_conversor_bin_a_prg
toFoxBin2Prg.writeLog(' ' + JUSTFNAME(.c_InputFile) + ' est<73> en el filtro DBF_Conversion_Excluded (' + toFoxBin2Prg.DBF_Conversion_Excluded + ')' )
EXIT
ENDIF
loDBFUtils.getDBFmetadata( .c_InputFile, @ln_HexFileType, @ll_FileHasCDX, @ll_FileHasMemo, @ll_FileIsDBC, @lc_DBC_Name )
lc_FileTypeDesc = loDBFUtils.fileTypeDescription(ln_HexFileType)
lnDatabases_Count = ADATABASES(laDatabases)
@@ -16021,7 +16086,7 @@ DEFINE CLASS CL_DBF_TABLE AS CL_CUS_BASE
IF FILE(lcTableCFG)
toFoxBin2Prg.writeLog()
toFoxBin2Prg.writeLog('* Found configuration file: ' + lcTableCFG)
*-- Leer valores de configuraci<63>n
FOR I = 1 TO ALINES( laConfig, FILETOSTR( lcTableCFG ), 1+4 )
lcConfigItem = LOWER( laConfig(I) )
@@ -16040,15 +16105,15 @@ DEFINE CLASS CL_DBF_TABLE AS CL_CUS_BASE
ENDCASE
ENDFOR
IF NOT EMPTY(lc_DBF_Conversion_Order)
lcIndexFile = FORCEEXT(tc_InputFile,'IDX')
INDEX ON &lc_DBF_Conversion_Order. TO (lcIndexFile) COMPACT
toFoxBin2Prg.writeLog(' > Using Index order key: ' + lc_DBF_Conversion_Order)
ENDIF
ENDIF
*** DH 06/02/2014: added _Records
loRecords = THIS._Records
lcText = lcText + loRecords.toText(@laFields, lnFieldCount, lc_DBF_Conversion_Condition)
@@ -16670,7 +16735,7 @@ DEFINE CLASS CL_DBF_RECORDS AS CL_COL_BASE
ENDTEXT
loRecord = CREATEOBJECT('CL_DBF_RECORD')
IF EMPTY(tc_DBF_Conversion_Condition)
tc_DBF_Conversion_Condition = '.T.'
ENDIF