Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Timing and ADIR
Message
From
12/10/2001 20:09:44
 
 
To
12/10/2001 15:15:12
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00567902
Message ID:
00568047
Views:
19
I wrote this to solve the problem in FPW 2.6

It works in all circumstances I have met so far
FUNC DOSRun
PARAMETER lcCommand
lcTmpFile=SYS(2023)+'\'+SYS(3)+'.BAT'
lcFinFile=strtran(lcTmpFile,'.BAT','.FIN')
nFH = FCREATE(lcTmpFile)
=FPUTS(nFH, lcCommand)
=FPUTS(nFH,'ECHO FINISHED >> '+lcFinFile)
=FPUTS(nFH,'EXIT')
=FCLOSE(nFH)
IF FILE(lcTmpFile)
	lcExecute='RUN /N FOXRUN.PIF /C '+lcTmpFile
	&lcExecute
	llretval=.t.
ELSE
  WAIT WINDOW 'Unable to create batch file'
  llretval=.f.
endif
llmore=.t.
do while !file(lcFinFile) && scan loop to check for existence of the finish file '????????.FIN'
   wait window 'DOS Command Executing ' timeout 1	
enddo
ERASE (lcTmpFile)
ERASE (lcFinFile)
wait window 'Finished Command' nowait
return llretval
>I am using code to run a batch file that puts a file into a specific directory. As so as the file gets to this directory I want to rename the file. I don,t know want the original file name will be because the app that creates it uses a random naming process which I can't change. So When my code runs it first cleans out the directory, runs the batch which places one file into the directory. Now I can do ADIR(myArray) and find the name of the only file then us remname to give the file a logical name. My trouble is the ADIR wants to exicute before the batch file has time to put the file into the directory. How can I pause the ADIR() code until it has an element?
Previous
Reply
Map
View

Click here to load this message in the networking platform