b001
asked on
WAIT WINDOW does not show text
Hi Experts
I am using the following code to copy large file and while copying wait window shows the progress.
Procedure large_file
Lparameters fileoldx,filenewx, FILENAMEX
hFile = Fopen('&fileoldx', 0) && get handle to file
hFileDestination = Fcreate('&filenewx', 0) && get handle to destination file
nFileSize = Fseek(hFile,0,2) && go to end of file
= Fseek(hFile,0,0) && go to beginning of file
nWritten = 0
Do While Not Feof(hFile)
cLine = Fread(hFile,2048)
= Fwrite(hFileDestination,cL ine)
nWritten = nWritten+2048
Store 'Copying. '+FILENAMEX+' '+Str(Min(nWritten/nFileSi ze,1)*100, 6,2)+'%' To waitcap
Wait Window waitcap At 35,40 Nowait
Enddo
= Fclose(hFile)
= Fclose(hFileDestination)
Wait Clear
Endproc
I works fine on all windows OS.
I have new machine with window8.
It does the copying but wait window shows blank , only when the copy completed then it say 100%.
Please help.
Thanks
I am using the following code to copy large file and while copying wait window shows the progress.
Procedure large_file
Lparameters fileoldx,filenewx, FILENAMEX
hFile = Fopen('&fileoldx', 0) && get handle to file
hFileDestination = Fcreate('&filenewx', 0) && get handle to destination file
nFileSize = Fseek(hFile,0,2) && go to end of file
= Fseek(hFile,0,0) && go to beginning of file
nWritten = 0
Do While Not Feof(hFile)
cLine = Fread(hFile,2048)
= Fwrite(hFileDestination,cL
nWritten = nWritten+2048
Store 'Copying. '+FILENAMEX+' '+Str(Min(nWritten/nFileSi
Wait Window waitcap At 35,40 Nowait
Enddo
= Fclose(hFile)
= Fclose(hFileDestination)
Wait Clear
Endproc
I works fine on all windows OS.
I have new machine with window8.
It does the copying but wait window shows blank , only when the copy completed then it say 100%.
Please help.
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Captain,
do you think the AT clause causes blank wait window on Windows 8 ?
do you think the AT clause causes blank wait window on Windows 8 ?
ASKER
I have tried without AT, no difference.
OK, I supposed that.
What about the =INKEY(0.1) command?
What about the =INKEY(0.1) command?
ASKER
HI pcelba
= INKEY(0.1)
yes this works.
how can I redraw screen avery 5 seconds so it does not slow down?
Thanks
= INKEY(0.1)
yes this works.
how can I redraw screen avery 5 seconds so it does not slow down?
Thanks
You'll need to record the current time:
LOCAL lnStartTime
lnStartTime = SECONDS()
Do While Not Feof(hFile)
cLine = Fread(hFile,2048)
= Fwrite(hFileDestination,cLine)
nWritten = nWritten+2048
Store 'Copying. '+FILENAMEX+' '+Str(Min(nWritten/nFileSize,1)*100,6,2)+'%' To waitcap
Wait Window waitcap At 35,40 Nowait
IF SECONDS() - m.lnStartTime > 5
= INKEY(0.1)
lnStartTime = SECONDS()
ENDIF
Enddo
Not really, pcelba, but I thought maybe somehow it is shooting for Foxels outside the range of the screen instead of pixels if for some reason the screen font changed. I never worked under Windows 8 so I don't know what type of bugs/issues it has :).
WAIT WINDOW 'Copying. '+FILENAMEX+' '+Str(Min(nWritten/nFileSi