Changeset: 180 fernando - 01/03/2014 12:23:43:
v1.19.14 - Agregadas 2 funciones para poder evaluar el soporte de conversiones de forma externa (requiere EvaluarConfiguracion() previamente). Usado en los scripts - Arreglo bug ExtraBackupLevels: cuando no se define no se genera backup
This commit is contained in:
@@ -13,14 +13,13 @@
|
||||
'---------------------------------------------------------------------------------------------------
|
||||
Const ForReading = 1
|
||||
Dim WSHShell, FileSystemObject
|
||||
Dim oVFP9, nExitCode, cEXETool, cCMD, nDebug, cConvertType, aExtensions(8), foxbin2prg_cfg, aFiles(), nFile_Count
|
||||
Dim oVFP9, nExitCode, cEXETool, cCMD, nDebug, lcExt, foxbin2prg_cfg, aFiles(), nFile_Count
|
||||
Dim i, x, str_cfg, aConf, cErrMsg, cFlagGenerateLog, cFlagDontShowErrMsg, cFlagJustShowCall, cFlagRecompile, cNoTimestamps
|
||||
Set WSHShell = WScript.CreateObject("WScript.Shell")
|
||||
Set FileSystemObject = WScript.CreateObject("Scripting.FileSystemObject")
|
||||
Set oVFP9 = CreateObject("VisualFoxPro.Application.9")
|
||||
foxbin2prg_cfg = Replace(WScript.ScriptFullName, WScript.ScriptName, "foxbin2prg.cfg")
|
||||
nExitCode = 0
|
||||
cConvertType = "PRG2BIN" '<<< This is the only difference between the 2 scripts
|
||||
'---------------------------------------------------------------------------------------------------
|
||||
'Cumulative Flags:
|
||||
' 0=OFF
|
||||
@@ -32,54 +31,8 @@ cConvertType = "PRG2BIN" '<<< This is the only difference between the 2 scripts
|
||||
nDebug = 1+0+4+0+16
|
||||
'---------------------------------------------------------------------------------------------------
|
||||
|
||||
If cConvertType = "BIN2PRG" Then
|
||||
aExtensions(1) = "PJX"
|
||||
aExtensions(2) = "VCX"
|
||||
aExtensions(3) = "SCX"
|
||||
aExtensions(4) = "FRX"
|
||||
aExtensions(5) = "LBX"
|
||||
aExtensions(6) = "DBF"
|
||||
aExtensions(7) = "DBC"
|
||||
aExtensions(8) = "MNX"
|
||||
Else
|
||||
'-- Extensiones TXT por defecto
|
||||
aExtensions(1) = "PJ2"
|
||||
aExtensions(2) = "VC2"
|
||||
aExtensions(3) = "SC2"
|
||||
aExtensions(4) = "FR2"
|
||||
aExtensions(5) = "LB2"
|
||||
aExtensions(6) = "DB2"
|
||||
aExtensions(7) = "DC2"
|
||||
aExtensions(8) = "MN2"
|
||||
|
||||
If FileSystemObject.FileExists( foxbin2prg_cfg ) Then
|
||||
'-- Existe el archivo de configuraci<63>n foxbin2prg.cgf
|
||||
Set objTextFile = FileSystemObject.OpenTextFile( foxbin2prg_cfg, ForReading )
|
||||
|
||||
Do Until objTextFile.AtEndOfStream
|
||||
strNextLine = objTextFile.Readline
|
||||
arrFb2p_CFG = Split(strNextLine , ",")
|
||||
For i = 0 to Ubound(arrFb2p_CFG)
|
||||
If Left( arrFb2p_CFG(i), 10 ) = "extension:" Then
|
||||
aConf = Split( arrFb2p_CFG(i), ":" ) 'Obtengo la separaci<63>n de "extensi<73>n:" y "ext:equiv"
|
||||
str_cfg = UCase( Trim( aConf(1) ) )
|
||||
aConf = Split( str_cfg, "=" ) 'Obtengo la separaci<63>n de extensi<73>n y equivalencia (vc2=vca)
|
||||
|
||||
For x = 1 TO 8
|
||||
If aExtensions(x) = aConf(0) Then
|
||||
aExtensions(x) = UCase( aConf(1) )
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
Else
|
||||
'Wscript.Echo "Saltear: " & arrFb2p_CFG(i)
|
||||
End If
|
||||
Next
|
||||
Loop
|
||||
End If
|
||||
End if
|
||||
|
||||
If WScript.Arguments.Count = 0 Then
|
||||
'SIN PAR<41>METROS
|
||||
nExitCode = 1
|
||||
cErrMsg = "nDebug = " & nDebug
|
||||
If GetBit(nDebug, 1) Then
|
||||
@@ -99,11 +52,14 @@ If WScript.Arguments.Count = 0 Then
|
||||
End If
|
||||
MsgBox cErrMsg, 64, "No parameters - Debug Status"
|
||||
Else
|
||||
'CON PAR<41>METROS
|
||||
cEXETool = Replace(WScript.ScriptFullName, WScript.ScriptName, "foxbin2prg.exe")
|
||||
nFile_Count = 0
|
||||
oVFP9.DoCmd( "SET PROCEDURE TO '" & cEXETool & "'" )
|
||||
oVFP9.DoCmd( "PUBLIC oFoxBin2prg" )
|
||||
oVFP9.DoCmd( "oFoxBin2prg = CREATEOBJECT('c_foxbin2prg')" )
|
||||
'.o_FoxBin2Prg.EvaluarConfiguracion( tcDontShowProgress, tcDontShowErrors, tcNoTimestamps, tcDebug, tcRecompile, tcExtraBackupLevels )
|
||||
oVFP9.DoCmd( "oFoxBin2prg.EvaluarConfiguracion( '1', '1' )" )
|
||||
oVFP9.DoCmd( "oFoxBin2prg.cargar_frm_avance()" )
|
||||
|
||||
For i = 0 To WScript.Arguments.Count-1
|
||||
@@ -185,14 +141,13 @@ End Sub
|
||||
|
||||
|
||||
Private Sub evaluateFile( tcFile )
|
||||
For x = 1 TO UBound(aExtensions,1)
|
||||
If aExtensions(x) = UCase( FileSystemObject.GetExtensionName( tcFile ) ) Then
|
||||
nFile_Count = nFile_Count + 1
|
||||
ReDim Preserve aFiles(nFile_Count)
|
||||
aFiles(nFile_Count) = tcFile
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
lcExt = UCase( FileSystemObject.GetExtensionName( tcFile ) )
|
||||
oVFP9.SetVar "gc_Ext", lcExt
|
||||
If oVFP9.Eval("oFoxBin2prg.TieneSoporte_Prg2Bin(gc_Ext)") Then
|
||||
nFile_Count = nFile_Count + 1
|
||||
ReDim Preserve aFiles(nFile_Count)
|
||||
aFiles(nFile_Count) = tcFile
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user