Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Show folder
Message
 
To
19/05/2005 02:51:41
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 7
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01015716
Message ID:
01015722
Views:
40
Here's one way to do it...
LOCAL lcSourceDirectory, lcDestinationDirectory, lcFileName
lcSourceDirectory = GETDIR("","Select Source Directory","Select",64)
IF !EMPTY(lcSourceDirectory)
	lcDestinationDirectory = GETDIR("","Select Destination Directory","Select",64)
	IF !EMPTY(lcDestinationDirectory)
		SET DEFAULT TO (lcSourceDirectory)
		lcFileName = SYS(2000,"*.*") && modify mask depending on what you want to copy, right now it copies all
		DO WHILE !EMPTY(lcFilename)
			COPY FILE (lcFilename) TO (lcDestinationDirectory + JUSTFNAME(lcFilename))
			lcFileName = SYS(2000,"*.*",1) && modify mask depending on what you want to copy, right now it copies all
		ENDDO
	ELSE
		MESSAGEBOX("Destination directory is required.", 64, "Copy Process Terminated")
	ENDIF
ELSE
	MESSAGEBOX("Source directory is required.", 64, "Copy Process Terminated")
ENDIF
You could add additional code to create the destination directory if it doesn't exist using the MKDIR command.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform