Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

overwiting a file prob.

Status
Not open for further replies.

Holm78

Programmer
Mar 5, 2002
60
SE
Hi

The user select a file to be copied and then the user select a server where the file should be copied to.
And if a file allready exists a messagebox apear and ask if you want to replace the file. the code:

if not file(addbs(alltrim('\\m10878300010\'+v_target))+filename)

copy file v_katalog + '*.*' to '\\m10878300010\' + v_target

else
m.svar = 0
m.svar = messagebox('Skal filen '+addbs(alltrim('\\m10878300010\'+v_target))+filename+' ersättas med ';
+addbs(alltrim(v_katalog))+filename+'?',4+32,'Bekräfta kopiering')
if svar = 6
copy file v_katalog + '*.*' to '\\m10878300010\' + v_target
endif
endif

After the user has made his selection VFP ask once again in english if the user wants to replace the file.

Is there a way to prevent vfp to ask the question by itself??

Thanks for help.

//Holm
 
You can also try using FILE() to see if the file already exists, and delete it if it does (or ask to overwrite, then delete it), then copy the new file in.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top