View Single Post
  #2 (permalink)  
Old 09-16-2007, 10:49 PM
Cableguy's Avatar
Cableguy Cableguy is online now
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 1,310
Default

From the looks of your code section.exe generates a txt file named "SectionSelected.text", and you are having trouble getting the data because the section.exe is taking more time to create the file...

If so you can use FileExist to check if the txt file already exist...

Code:
Sub Button1_click

Shell("section.exe")
Do While FileExist ("myFile.txt") =  False
DoEvents
Loop
'This waits for the file to be present before trying to open it

FileOpen (c1,AppPath&"\SectionSelected.text",cRead)
lbsection.Text= FileRead (c1)
FileClose(c1)
						
End Sub
I would also suggest you made sure that the file is after deleted so that the next time the sub is runned the file is NOT there, or you will load the wrong file (outdated)...
__________________
Paulo Gomes
Porto, Portugal

PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD
PPC: Qtek9000, 1GB SD

DLL Version Listing

Last edited by Cableguy : 09-16-2007 at 10:52 PM.
Reply With Quote