Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Create folder and copy data into it
Message
 
To
28/09/2004 02:50:45
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00946159
Message ID:
00946556
Views:
28
Tariq,
That means that there are no files ifrom the selected type in the folder You choose.

Just check before copy:
** Tracy's code

cFolder1 = "C:\profiler32\data\"
cFolder2 = "c:\temp1"
cfiles = cFolder1+"*.dbf"

DECLARE INTEGER CreateDirectory IN kernel32;
		STRING lpPathName, INTEGER lpSecurityAttr

IF !DIRECTORY(cfolder2)
	IF CreateDirectory (cFolder2, 0) = 0
		=MESSAGEBOX('Could not create '+cfolder2)
		RETURN
	ENDIF
	IF !DIRECTORY(cfolder2)
		=MESSAGEBOX('Could not create '+cfolder2)
		RETURN
	ENDIF
ENDIF

IF ADIR(allfiles,cfiles) > 0 && Check If ADIR returns some files

   DECLARE INTEGER CopyFile IN kernel32;
                   STRING  lpExistingFileName,;
                   STRING  lpNewFileName,;
                   INTEGER bFailIfExists

   FOR i = 1 TO ALEN(allfiles,1)
	=CopyFile(cfolder1+allfiles(i,1), cfolder2+"\"+allfiles(i,1), 0)
   ENDFOR
ENDIF
return
>Hello Dear
>
>Thanks for helping. I have test your codes.
>Following error message appears
>
>Variable "allfiles" is not found
>
>and debugger stops on this line of code
>
>FOR i = 1 TO ALEN(allfiles,1)
>
>What is wrong pleae modify and help again.
>
>Thanks in advance
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform