lcHMISPath = 'C:\projects\csst\HMIS\' lcFileName = 'export.csv' RunAny(lcHMISPath + 'XML\CSST_HMIS.exe',,lcFileName)But fails when called with this code from a menu procedure within a running application, where the laFiles[lnIndex,1] value is "export.csv"?
FOR lnIndex = 1 TO ALEN(laFiles,1) lcFileName = laFiles[lnIndex,1] WAIT 'Processing ' + lcFilename NOWAIT RunAny(lcHMISPath + 'XML\CSST_HMIS.exe',,lcFileName) DOEVENTS Sleep(1000) ENDFORBoth call the same "RunAny" sub:
*=================================================== * FUNCTION RunAny * LPARAMETERS tcExecutableFileName,tcOperation,tcParms,tcWorkDir * IF EMPTY(tcExecutableFileName) RETURN .F. ENDIF tcOperation = IIF(EMPTY(tcOperation),'open',tcOperation) tcParms = IIF(EMPTY(tcParms),'',tcParms) tcWorkDir = IIF(EMPTY(tcWorkDir),'',tcWorkDir) DECLARE INTEGER ShellExecute ; IN SHELL32.DLL ; INTEGER nWinHandle,; STRING cOperation,; STRING cFileName,; STRING cParameters,; STRING cDirectory,; INTEGER nShowWindow RETURN ShellExecute(0,tcOperation,tcExecutableFileName,tcParms,tcWorkDir,1) * *====================================================