From ca7b80960c10033ed95acc4d797cb0d5d34118ed Mon Sep 17 00:00:00 2001 From: Lutz Date: Mon, 15 Feb 2021 17:38:24 +0100 Subject: [PATCH 1/2] Bug Fix: log while processing dir, multi classes While processing directories, the log file was flushed per file, so only log last file It should be extended to file, but for some reason it will not work, so simply used different place to write once An aborted git merge might create multiple files of a class. Text2Bin will create many classes with the same name in the vcx. Only one class will be created. This might be with errors in syntax anyway, because of git merge information --- foxbin2prg.prg | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/foxbin2prg.prg b/foxbin2prg.prg index 61f3b49..393cd73 100644 --- a/foxbin2prg.prg +++ b/foxbin2prg.prg @@ -230,7 +230,7 @@ * 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 -* xx/02/2021 Lutz Scheffler proposed: conversion prg -> vcx, files per class could create one class multiple times +* 16/02/2021 Lutz Scheffler conversion prg -> vcx, files per class could create one class multiple times * * *--------------------------------------------------------------------------------------------------- @@ -3276,7 +3276,8 @@ DEFINE CLASS c_foxbin2prg AS Session *!* 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 -* .writeLog_Flush() moved after ENDFOR +* why ever, it should be appended, but we simply move +* .writeLog_Flush() after ENDFOR * .writeLog_Flush() @@ -3345,7 +3346,8 @@ DEFINE CLASS c_foxbin2prg AS Session *!* 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 -* .writeLog_Flush() moved after ENDFOR +* why ever, it should be appended, but we simply move +* .writeLog_Flush() after ENDFOR * .writeLog_Flush() @@ -10385,6 +10387,9 @@ DEFINE CLASS c_conversor_prg_a_vcx AS c_conversor_prg_a_bin , laLineasExclusion(1), lnBloquesExclusion, I, lcClassName, lnIDInputFile, llReplaceClass, lnRow ; , 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 @@ -10426,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 From 778b678dfa863e69a03471baa021011f2d803ee8 Mon Sep 17 00:00:00 2001 From: Lutz Date: Fri, 19 Feb 2021 15:25:03 +0100 Subject: [PATCH 2/2] Keep Blocksize to standard --- foxbin2prg.prg | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/foxbin2prg.prg b/foxbin2prg.prg index 393cd73..05b7e70 100644 --- a/foxbin2prg.prg +++ b/foxbin2prg.prg @@ -6254,7 +6254,9 @@ DEFINE CLASS c_conversor_base AS Custom SET SAFETY OFF SET MULTILOCKS ON SET TABLEPROMPT OFF - SET BLOCKSIZE TO 0 +* SF deactivated to keep standard +* SET BLOCKSIZE TO 0 +* /SF SET EXACT ON IF NOT EMPTY( ON("ESCAPE") ) THEN SET ESCAPE ON @@ -12961,6 +12963,7 @@ DEFINE CLASS c_conversor_prg_a_dbf AS c_conversor_prg_a_bin ENDIF ENDIF + &lcIndex. ENDFOR