Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP9 test EXE doesn't respect parameters :-(
Message
De
23/12/2013 10:09:33
 
 
À
23/12/2013 07:00:15
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01590839
Message ID:
01590880
Vues:
94
Ok, I have a solution. Not the best solution because it involves a 3rd.party, but it's ok.
I did a script (vbscript) that receives all the params and instance "VisualFoxPro.Application.9" then executes my program, passing all the params.

Just in case someone is interested, this is what the vbscript like:

Dim WSHShell
Dim oVFP9, nExitCode, cEXETool, cCMD, nDebug
Set oVFP9 = CreateObject("VisualFoxPro.Application.9")
nExitCode = 0
nDebug = 0

If WScript.Arguments.Count = 0 Then
nExitCode = 1
MsgBox "No parameters"
Else
If nDebug = 1 Then
cEXETool = Replace(WScript.ScriptFullName, WScript.ScriptName, "tst_diff.bat")
cCMD = chr(34) & cEXETool & chr(34) & " " & chr(34) & WScript.Arguments(0) & chr(34)
Else
cEXETool = Replace(WScript.ScriptFullName, WScript.ScriptName, "foxpro_plasticscm_dm.exe")
cCMD = "DO " & chr(34) & cEXETool & chr(34) & " WITH " & chr(34) & WScript.Arguments(0) & chr(34)
End If


For I = 1 To WScript.Arguments.Count - 1
cCMD = cCMD & "," & chr(34) & WScript.Arguments(I) & chr(34)
Next

If nDebug = 1 Then
MsgBox cCMD, 0, "PARÁMETROS ENVIADOS"
WSHShell.Run( cCMD )
Else
oVFP9.DoCmd( cCMD )
nExitCode = oVFP9.Eval("_SCREEN.ExitCode")
End If
End If

WScript.Quit(nExitCode)


Thanks for the help and ideas!
Fernando D. Bozzo
Madrid / Spain
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform