[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1058
  • Last Modified:

progress bar in VFP9

Hi Experts
I am copying a large file to an other device during backup and using _thermometer as progress bar.
My progress bar is stuck at one place wihle it is copying this large file.
I would like to see my progress bar moving according to how much data been transfered !

Please help
Thanks
0
b001
Asked:
b001
  • 2
1 Solution
 
CaptainCyrilCommented:
You can to copy the file using low level function.
FOPEN, FREAD, FWRITE, FCLOSE and track the number of bytes being written.
0
 
b001Author Commented:
Hi CaptainCyril
please write the code for me.
Thanks
0
 
CaptainCyrilCommented:
I did not test this but it will give you a headstart


hFile = FOPEN(cFileName, 0) && get handle to file
hFileDestination = FCREATE(cFileName1, 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,1024)
        = FWRITE(hFileDestination,cLine)
        nWritten = nWritten+1024
       WAIT WINDOW STR(MIN(nWritten/nFileSize,1)*100,6,2)+'%' NOWAIT
ENDDO
= FCLOSE(hFile)
= FCLOSE(hFileDestination)
WAIT CLEAR
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now