Situation ... I have an external file mangler that runs from a shell commandline ... I have a function that calls this;
public function fileMangler(strFile as string) as boolean
dim fs
set fs = createobject("Scripting.FileSystemObject")
if fs.fileexists(strFile) then
if 0 = shell(g_str_mangler & " " & strfile) then goto fm_err
loErr = doevents
loerr = doevents
endif
filemangler = false
exit function
fm_err:
filemangler = true
end function
I then have a function that calls this
if filemangler(g_str_file1) then goto err1
loErr = doevents
loErr = doevents
if filemangler(g_str_file2) then goto err2
loErr = doevents
loErr = doevents
At issue is the first instance of filemangler hasn't finished so when the second istance runs it appears to be confused ... this is a third party program so expect its not reentrant ... is there a better way to ensure external calls are complete before allowing the program to continue?
public function fileMangler(strFile as string) as boolean
dim fs
set fs = createobject("Scripting.FileSystemObject")
if fs.fileexists(strFile) then
if 0 = shell(g_str_mangler & " " & strfile) then goto fm_err
loErr = doevents
loerr = doevents
endif
filemangler = false
exit function
fm_err:
filemangler = true
end function
I then have a function that calls this
if filemangler(g_str_file1) then goto err1
loErr = doevents
loErr = doevents
if filemangler(g_str_file2) then goto err2
loErr = doevents
loErr = doevents
At issue is the first instance of filemangler hasn't finished so when the second istance runs it appears to be confused ... this is a third party program so expect its not reentrant ... is there a better way to ensure external calls are complete before allowing the program to continue?