I need to execute a program from within my program. Normally this is not a problem, but for some reason the parameters issue is giving me some problems.
The normal command line call would be in this format:
The usage syntax for executing ABCUpload.exe is:
ABCUpload.exe <user_name> <password> <license_key> <xml_file> [-DELZIP]
Example:
ABCUpload.exe ABCLoginAccount@abc.com secretp@ssw0rd ABCDEF90-1234-5678-90AB-CDEF12345678 "C:\ABCFolder\MyDatas.xml
The user name, password, and license key are all drawn from data files, so I need to substituted variables. I have tried to implement the code as follows:
dffull displays what appears to be a proper formatted string. However, nResult returns -1 and the logfile is not created.
Am I handling the formatting of this string correctly ?
Thanks.
Tim
The normal command line call would be in this format:
The usage syntax for executing ABCUpload.exe is:
ABCUpload.exe <user_name> <password> <license_key> <xml_file> [-DELZIP]
Example:
ABCUpload.exe ABCLoginAccount@abc.com secretp@ssw0rd ABCDEF90-1234-5678-90AB-CDEF12345678 "C:\ABCFolder\MyDatas.xml
The user name, password, and license key are all drawn from data files, so I need to substituted variables. I have tried to implement the code as follows:
FUNCTION ABCupload
LOCAL dfcall := cPath + "ABCUpload.exe "
LOCAL dfuser, dfpass, dflicn, dffull
LOCAL dffile := cpath + "MyData.xml "
LOCAL dfxtnd := '-DELZIP >> logfile.txt'
// Get the stored values
oDcf := tdata():new(, cPath + "dForce\dfsetu" )
oDcf:use()
oDcf:goto( 1 )
// Set the values and create the execute string
dfuser := TRIM(oDcf:dfssid) + SPACE(1)
dflicn := TRIM(oDcf:dfskey) + SPACE(1)
dfpass := TRIM(oDcf:dfpass) + SPACE(1)
dffull := dfcall + dfuser + dfpass + dflicn + '"' + dffile + '"' + dfxtnd
oDcf:close( )
// Now execute the transmission
MsgInfo( dffull )
nResult := WaitRun( dffull )
MsgInfo( nResult )
RETURN NILdffull displays what appears to be a proper formatted string. However, nResult returns -1 and the logfile is not created.
Am I handling the formatting of this string correctly ?
Thanks.
Tim
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit