120
foxbin2prg.prg
120
foxbin2prg.prg
@@ -225,6 +225,12 @@
|
||||
* 01/04/2020 DH v1.19.51 Bug Fix: Manejo de AutoIncrement incompatible con Project Explorer (Dan Lauer)
|
||||
* 01/04/2020 FDBOZZO v1.19.51 Bug Fix: La conversión de tablas falla si algún campo contiene una palabra reservada como UNIQUE (DAJU78)
|
||||
* 01/04/2020 FDBOZZO v1.19.51 Bug Fix: No se respetan las propiedades de VCX/SCX con nombre "note" (Tracy Pearson)
|
||||
|
||||
* 14/02/2021 Lutz Scheffler conversion dbf -> prg, error if only test mode (toFoxBin2Prg.l_ProcessFiles is false)
|
||||
* minor translations
|
||||
* 14/02/2021 Lutz Scheffler conversion prg -> dbf, fields with .NULL. value are incorectly recreated
|
||||
* 15/02/2021 Lutz Scheffler processing directory, flush log file after loop instead of file
|
||||
* 16/02/2021 Lutz Scheffler conversion prg -> vcx, files per class could create one class multiple times
|
||||
* </HISTORIAL DE CAMBIOS Y NOTAS IMPORTANTES>
|
||||
*
|
||||
*---------------------------------------------------------------------------------------------------
|
||||
@@ -2137,6 +2143,7 @@ DEFINE CLASS c_foxbin2prg AS Session
|
||||
ELSE
|
||||
.writeLog( '> ' + UPPER(loLang.C_CACHING_CONFIG_FOR_DIRECTORY_LOC) + ': ' + lc_CFG_Path )
|
||||
lo_CFG = CREATEOBJECT('CL_CFG')
|
||||
|
||||
lo_Configuration.Add( lo_CFG, lc_CFG_Path )
|
||||
.n_CFG_Actual = lo_Configuration.Count
|
||||
|
||||
@@ -3266,7 +3273,13 @@ DEFINE CLASS c_foxbin2prg AS Session
|
||||
|
||||
.updateProgressbar( loLang.C_PROCESSING_LOC + ' ' + lcFile + '...', m.I, lnFileCount, 0 )
|
||||
lnCodError = .convert( lcFile, @toModulo, @toEx, .F., tcOriginalFileName )
|
||||
.writeLog_Flush()
|
||||
*!* Changed by: Lutz Scheffler 15.2.2021
|
||||
*!* change date="{^2021-02-15,06:57:00}"
|
||||
* flushing the log after each file let us only see last file
|
||||
* why ever, it should be appended, but we simply move
|
||||
* .writeLog_Flush() after ENDFOR
|
||||
|
||||
* .writeLog_Flush()
|
||||
|
||||
DO CASE
|
||||
CASE lnCodError = 1799 && Conversion Cancelled
|
||||
@@ -3276,6 +3289,8 @@ DEFINE CLASS c_foxbin2prg AS Session
|
||||
.doWriteErrorLog( @toEx )
|
||||
ENDCASE
|
||||
ENDFOR && I = 1 TO lnFileCount
|
||||
.writeLog_Flush()
|
||||
*!* /Changed by: Lutz Scheffler 15.2.2021
|
||||
|
||||
.updateProgressbar( loLang.C_END_OF_PROCESS_LOC, lnFileCount, lnFileCount, 0 )
|
||||
EXIT
|
||||
@@ -3317,6 +3332,7 @@ DEFINE CLASS c_foxbin2prg AS Session
|
||||
|
||||
.get_FilesFromDirectory( tc_InputFile, @laFiles, @lnFileCount )
|
||||
|
||||
|
||||
FOR I = 1 TO lnFileCount
|
||||
toModulo = NULL
|
||||
lcFile = laFiles(m.I)
|
||||
@@ -3327,7 +3343,13 @@ DEFINE CLASS c_foxbin2prg AS Session
|
||||
|
||||
.updateProgressbar( loLang.C_PROCESSING_LOC + ' ' + lcFile + '...', m.I, lnFileCount, 0 )
|
||||
lnCodError = .convert( lcFile, @toModulo, @toEx, .F., tcOriginalFileName )
|
||||
.writeLog_Flush()
|
||||
*!* Changed by: Lutz Scheffler 15.2.2021
|
||||
*!* change date="{^2021-02-15,06:57:00}"
|
||||
* flushing the log after each file let us only see last file
|
||||
* why ever, it should be appended, but we simply move
|
||||
* .writeLog_Flush() after ENDFOR
|
||||
|
||||
* .writeLog_Flush()
|
||||
|
||||
DO CASE
|
||||
CASE lnCodError = 1799 && Conversion Cancelled
|
||||
@@ -3337,6 +3359,8 @@ DEFINE CLASS c_foxbin2prg AS Session
|
||||
.doWriteErrorLog( @toEx )
|
||||
ENDCASE
|
||||
ENDFOR && I = 1 TO lnFileCount
|
||||
.writeLog_Flush()
|
||||
*!* /Changed by: Lutz Scheffler 15.2.2021
|
||||
|
||||
.updateProgressbar( loLang.C_END_OF_PROCESS_LOC, lnFileCount, lnFileCount, 0 )
|
||||
EXIT
|
||||
@@ -4553,14 +4577,14 @@ DEFINE CLASS c_foxbin2prg AS Session
|
||||
|
||||
|
||||
PROCEDURE get_FilesFromDirectory
|
||||
LPARAMETERS tcDir, taFiles, lnFileCount
|
||||
LPARAMETERS tcDir, taFiles, tnFileCount
|
||||
EXTERNAL ARRAY taFiles
|
||||
|
||||
LOCAL laFiles(1), I, lnFiles ;
|
||||
, loLang as CL_LANG OF 'FOXBIN2PRG.PRG'
|
||||
|
||||
IF TYPE("ALEN(laFiles)") # "N" OR EMPTY(lnFileCount)
|
||||
lnFileCount = 0
|
||||
IF TYPE("ALEN(laFiles)") # "N" OR EMPTY(tnFileCount)
|
||||
tnFileCount = 0
|
||||
DIMENSION taFiles(1)
|
||||
ENDIF
|
||||
|
||||
@@ -4577,9 +4601,10 @@ DEFINE CLASS c_foxbin2prg AS Session
|
||||
IF SUBSTR( laFiles(m.I,5), 5, 1 ) == 'D'
|
||||
LOOP
|
||||
ENDIF
|
||||
lnFileCount = lnFileCount + 1
|
||||
DIMENSION taFiles(lnFileCount)
|
||||
taFiles(lnFileCount) = tcDir + laFiles(m.I,1)
|
||||
|
||||
tnFileCount = tnFileCount + 1
|
||||
DIMENSION taFiles(tnFileCount)
|
||||
taFiles(tnFileCount) = tcDir + laFiles(m.I,1)
|
||||
ENDFOR
|
||||
|
||||
*-- Busco los subdirectorios
|
||||
@@ -10363,6 +10388,9 @@ DEFINE CLASS c_conversor_prg_a_vcx AS c_conversor_prg_a_bin
|
||||
, loClase AS CL_CLASE OF 'FOXBIN2PRG.PRG' ;
|
||||
, loLang as CL_LANG OF 'FOXBIN2PRG.PRG'
|
||||
|
||||
LOCAL;
|
||||
lnDots AS NUMBER
|
||||
|
||||
WITH THIS AS c_conversor_prg_a_vcx OF 'FOXBIN2PRG.PRG'
|
||||
STORE 0 TO lnCodError, lnCodeLines
|
||||
STORE '' TO C_FB2PRG_CODE, lcClassName
|
||||
@@ -10403,9 +10431,27 @@ DEFINE CLASS c_conversor_prg_a_vcx AS c_conversor_prg_a_bin
|
||||
lcInputFile = .c_InputFile
|
||||
ENDIF
|
||||
|
||||
*!* Changed by: Lutz Scheffler 15.2.2021
|
||||
*!* change date="{^2021-02-15,16:09:00}"
|
||||
* problem with classes declared in multiple files, looks like merge problem of git
|
||||
* creates multiple classes in VCX
|
||||
* the problem is ADIR(laFiles,Name+".*.ext") will return files with AT LEAST 2 dots
|
||||
* so we simply remove files with to many dots
|
||||
lnDots = OCCURS('.',m.lcInputFile)
|
||||
|
||||
lnFileCount = ADIR( laFiles, lcInputFile, "", 1 )
|
||||
|
||||
IF lnFileCount > 1
|
||||
FOR i = m.lnFileCount TO 1 STEP -1
|
||||
IF OCCURS('.',laFiles(i,1))>m.lnDots THEN
|
||||
ADEL(laFiles,i)
|
||||
lnFileCount = m.lnFileCount-1
|
||||
ENDIF &&OCCURS('.',laFiles(i,1))>m.lnDots
|
||||
NEXT
|
||||
DIMENSION;
|
||||
laFiles(EVL(lnFileCount,1),ALEN(laFiles,2))
|
||||
*!* /Changed by: Lutz Scheffler 15.2.2021
|
||||
|
||||
ASORT( laFiles, 1, 0, 0, 1)
|
||||
ENDIF
|
||||
|
||||
@@ -13022,7 +13068,6 @@ DEFINE CLASS c_conversor_prg_a_dbf AS c_conversor_prg_a_bin
|
||||
ENDDEFINE && CLASS c_conversor_prg_a_dbf AS c_conversor_prg_a_bin
|
||||
|
||||
|
||||
|
||||
DEFINE CLASS c_conversor_prg_a_dbc AS c_conversor_prg_a_bin
|
||||
#IF .F.
|
||||
LOCAL THIS AS c_conversor_prg_a_dbc OF 'FOXBIN2PRG.PRG'
|
||||
@@ -17482,12 +17527,29 @@ DEFINE CLASS c_conversor_dbf_a_prg AS c_conversor_bin_a_prg
|
||||
#ENDIF
|
||||
DODEFAULT( @toModulo, @toEx, @toFoxBin2Prg )
|
||||
|
||||
*!* Changed by: Lutz Scheffler 11.2.2021
|
||||
*!* change date="{^2021-02-11,08:50:00}"
|
||||
* If toFoxBin2Prg.l_ProcessFiles is not true
|
||||
* and the try block was exited
|
||||
* the stuff below was never instatiated
|
||||
|
||||
*so the whole try / catch block should not run
|
||||
|
||||
IF NOT toFoxBin2Prg.l_ProcessFiles THEN
|
||||
THIS.write_OutputFile( '', THIS.c_OutputFile, @toFoxBin2Prg )
|
||||
ELSE &&NOT toFoxBin2Prg.l_ProcessFiles
|
||||
*!* /Changed by: Lutz Scheffler 11.2.2021
|
||||
|
||||
TRY
|
||||
WITH THIS AS c_conversor_dbf_a_prg OF 'FOXBIN2PRG.PRG'
|
||||
IF NOT toFoxBin2Prg.l_ProcessFiles THEN
|
||||
.write_OutputFile( '', .c_OutputFile, @toFoxBin2Prg )
|
||||
EXIT && Si se indicó no procesar, se sale aquí. (Modo de simulación)
|
||||
ENDIF
|
||||
*!* Changed by: Lutz Scheffler 11.2.2021
|
||||
*!* change date="{^2021-02-11,08:50:00}"
|
||||
*moved up:
|
||||
* IF NOT toFoxBin2Prg.l_ProcessFiles THEN
|
||||
* .write_OutputFile( '', .c_OutputFile, @toFoxBin2Prg )
|
||||
* EXIT && Si se indicó no procesar, se sale aquí. (Modo de simulación)
|
||||
* ENDIF
|
||||
*!* /Changed by: Lutz Scheffler 11.2.2021
|
||||
|
||||
LOCAL lnCodError, laDatabases(1), lnDatabases_Count, laDatabases2(1) ;
|
||||
, lnLen, lc_FileTypeDesc, laLines(1), lcOutputFile ;
|
||||
@@ -17654,11 +17716,23 @@ DEFINE CLASS c_conversor_dbf_a_prg AS c_conversor_bin_a_prg
|
||||
ENDFOR
|
||||
|
||||
STORE NULL TO loTable, loDBFUtils, loTextStream, toFoxBin2Prg.o_TextStream
|
||||
RELEASE toModulo, toEx, toFoxBin2Prg, loTextStream ;
|
||||
*!* Changed by: Lutz Scheffler 11.2.2021
|
||||
*!* change date="{^2021-02-11,08:50:00}"
|
||||
* Release different, parts moved outsidef IF .. ENDIF
|
||||
RELEASE loTextStream ;
|
||||
, lnCodError, laDatabases, lnDatabases_Count, laDatabases2, lnLen, lc_FileTypeDesc ;
|
||||
, ln_HexFileType, ll_FileHasCDX, ll_FileHasMemo, ll_FileIsDBC, lc_DBC_Name, lnDataSessionID, lnSelect ;
|
||||
, loTable, loDBFUtils
|
||||
ENDTRY
|
||||
*!* Changed by: Lutz Scheffler 11.2.2021
|
||||
*!* change date="{^2021-02-11,08:50:00}"
|
||||
* so the whole try / catch block should not run if in simulation
|
||||
|
||||
ENDIF &&NOT toFoxBin2Prg.l_ProcessFiles
|
||||
|
||||
* Release from above
|
||||
RELEASE toModulo, toEx, toFoxBin2Prg, loTextStream ;
|
||||
*!* /Changed by: Lutz Scheffler 11.2.2021
|
||||
|
||||
RETURN
|
||||
ENDPROC
|
||||
@@ -17828,9 +17902,9 @@ DEFINE CLASS c_conversor_dbc_a_prg AS c_conversor_bin_a_prg
|
||||
*ENDFOR
|
||||
*toDatabase = lcCodigo
|
||||
ELSE
|
||||
|
||||
IF toFoxBin2Prg.n_UseClassPerFile > 0 THEN
|
||||
.write_OutputFile( @lcCodigo, lcOutputFile, @toFoxBin2Prg )
|
||||
|
||||
FOR I = 1 TO lnClassCount
|
||||
* lcOutputFile = '<path>DBCName' + '.' + 'MemberType' + '.' + 'MemberName' + '.' + 'dc2'
|
||||
lcOutputFile = ADDBS( JUSTPATH( .c_OutputFile ) ) + JUSTSTEM( .c_OutputFile ) + '.' + laClasses(m.I,3) + '.' + laClasses(m.I,1) + '.' + JUSTEXT( .c_OutputFile )
|
||||
@@ -25096,8 +25170,20 @@ DEFINE CLASS CL_DBF_RECORD AS CL_CUS_BASE
|
||||
|
||||
lcFieldType = loField._Type
|
||||
llNoCPTran = CAST( loField._NoCPTran as Logical)
|
||||
*!* Changed by: Lutz Scheffler 14.2.2021
|
||||
*!* change date="{^2021-02-14,20:35:00}"
|
||||
* Does not recreate .NULL. Field values
|
||||
* CAST(.. does not tronsform ".NULL." to .NULL.
|
||||
* so we test field for NULL flag and is cValue is ".NULL.", we use .NULL.
|
||||
|
||||
llNull = CAST( loField._Null as Logical)
|
||||
|
||||
DO CASE
|
||||
CASE m.llNull AND UPPER(m.lcValue)=='.NULL.' && .NULL.
|
||||
luValue = .NULL.
|
||||
|
||||
*!* /Changed by: Lutz Scheffler 14.2.2021
|
||||
|
||||
CASE lcFieldType == 'L' && Logical (Boolean)
|
||||
luValue = CAST(lcValue as Logical)
|
||||
|
||||
@@ -29067,7 +29153,7 @@ DEFINE CLASS CL_LANG AS Custom
|
||||
.C_CACHING_CONFIG_FOR_DIRECTORY_LOC = "Caching Config für Verzeichnis"
|
||||
.C_CANT_GENERATE_FILE_BECAUSE_IT_IS_READONLY_LOC = "Kann Datei [<<THIS.c_OutputFile>>] nicht generieren, da sie schreibgeschützt ist"
|
||||
.C_CLASSPERFILE_OPTIMIZATION_BASE_ALREADY_PROCESSED_LOC = "Optimierung: Grund Datei [<<JUSTFNAME(.c_InputFile)>>] Schon verarbeitet, das Überspringen Verarbeitung der Datei [<<tc_InputFile>>]"
|
||||
.C_CONFIGFILE_LOC = "Benutze Konfigurationsdatei:"
|
||||
.C_CONFIGFILE_LOC = "Benutzte Konfigurationsdatei:"
|
||||
.C_CONVERSION_CANCELLED_BY_USER_LOC = "Konvertierung durch den Benutzer abgebrochen"
|
||||
.C_CONVERT_ALL_FILES_IN_A_PROJECT_LOC = "alle Dateien in einem Projekt zu konvertieren"
|
||||
.C_CONVERT_FOLDER_LOC = "Konvertieren Verzeichnis"
|
||||
@@ -29205,7 +29291,7 @@ DEFINE CLASS CL_LANG AS Custom
|
||||
.C_PROCESSING_LOC = "Bearbeite Datei"
|
||||
.C_PROCESS_PROGRESS_LOC = "Bearbeitungsfortschritt:"
|
||||
.C_PROPERTY_NAME_NOT_RECOGNIZED_LOC = "Eigenschaft [<<TRANSFORM(tnPropertyID)>>] nicht erkannt."
|
||||
.C_READING_CFG_VALUES_FROM_DISK_LOC = "LESEWERTE CFG-DATEI AUF DER FESTPLATTE"
|
||||
.C_READING_CFG_VALUES_FROM_DISK_LOC = "Gelesene Werte der CFG-DATEI von der Festplatte"
|
||||
.C_REPORT_NOT_IN_VFP9_FORMAT_LOC = "Report [<<THIS.c_InputFile>>] ist NICHT in VFP 9 Format! - Bitte zuerst nach VFP 9 konvertieren mit MODIFY REPORT '<<THIS.c_InputFile>>'"
|
||||
.C_REQUESTING_CAPITALIZATION_OF_FILE_LOC = "- Forder Großschreibung für Datei [<<tcFileName>>] an"
|
||||
.C_SCANNING_FILE_AND_DIR_INFO_LOC = "Scanne Datei- und Verzeichnisinformationen für"
|
||||
|
||||
Reference in New Issue
Block a user