|
gablea on 08/16/11 - 09:51:49
Hi all
how do I copy a file with in my App so I can display a message saying Transfering product.dat 12% ||||||-------- ||||----- is to be a ascii process bar. any thoughts?
Todd on 09/07/11 - 14:17:43
I don't have the QB docs open at the moment but what you would need to do is determine the file size using a DOS API call/interrupt and then store the size in a LONG or DOUBLE. Then open the file in binary input mode and allocate a small buffer (more than likely a string) in memory (16 KB is good) and read the data into the string with 16 KB at a time. Then write the data to the new location using a file pointer opened in binary output mode. One concern is when you read the end of the file and it's less than 16 KB. You will need a way to find how much data was read in (again may be in the QB docs) then save it as the last part of the file.
The progress bar is simple since you store a long for the size and a long for the data that has been read and transferred. The progress is refreshed each time you read part of the file.
TopGun on 09/09/11 - 23:47:46
u can use something like this perhaps:
do progress = progress + 1 if progress > 100 then END LOCATE 10,6: print str$(progress) + "----------" for bar = 0 to progress locate 10, 10 + bar: print "|" next bar loop Something like that, I never tested the code but pretty sure it works. Should be easy to modify to your program I think :)
TopGun on 09/09/11 - 23:54:47
LOL pretty sure that's not what you're looking for HAHA it's been a long day! But even still it might come in handy lol
Plasma on 10/27/11 - 20:00:57
Reply to this message
|
|