BBS: Inland Empire Archive
Date: 02-16-93 (14:51) Number: 218
From: ZACK JONES Refer#: NONE
To: ALL Recvd: NO
Subj: Echo Project #1 Conf: (2) Quik_Bas
Ok - it's time to get an echo-wide programmng project
going. For our first one I'd like to take this filecopy
sub routine and make some enhancements to it. First I'll
post the sub routine and then I'll provide a list of
enhancements I'd like to add. Here's the subroutine:
SUB FileCopy (Source$, Dest$)
X = 1: REDIM Transfer(1 TO X) AS STRING * 1024
OPEN Source$ FOR BINARY AS 1
OPEN Dest$ FOR BINARY AS 2
Length& = LOF(1)
Total& = 0
GET #1, , Transfer(1)
IF Total& + LEN(Transfer(1)) <= Length& THEN
Trans$ = Transfer(1)
Trans$ = LEFT$(Transfer(1), Length& - Total&)
Total& = Total& + LEN(Trans$)
PUT #2, , Trans$
Complete% = INT((Total& / Length&) * 100)
LOCATE 14, 35: COLOR 15: PRINT USING "###% complete! "; Complete%;
LOCATE 15, 17: PRINT STRING$(Complete% \ 2, 219);
IF Total& >= Length& THEN EXIT DO
Ok - not too much to it is there. I'd to add the following enhancements:
1 - ability to use wild cards.
2 - ability to call the routine with just the source filename and
path to copy the file to.
3 - an error handler for disk errors
4 - a nice windowing routine to display the whole process in a window
(I have source for that so I'll add that part first)
5 - the ability to delete the source file if we wanted to.
6 - Anything else you folks can think of that would be nice to add.
Please provide your suggestions/code to me and I'll add
them to the program. Remember - all code used is considered
public domain and anyone can use it for any purpose.
Take Care, Zack Jones
--- GoldED 2.41.B1207+1536
* Origin: Zack's Shack San Antonio TX (210) 653-2115 (1:387/641)