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!

CopyFile?

Status
Not open for further replies.

binbyte

Technical User
Nov 24, 2004
11
AR
Help friends

I am writing a delphi program from visual basic and have a problem with visual basic filecopy:

CMDialog.Filename <> "" Then FileCopy "outfile.txt", CMDialog.Filename

where CMdialog is from commondialog

it`s posible use CopyFile and how?
 

The CopyFile function is in Windows.pas

TOpenDialog is in Dialogs.pas

Assuming you are prompting the user to find the file to be copied, you can use TOpenDialog to allow him/her to find it.

If you are prompting for a file to be replaced, you can use a TSaveDialog.

 
A little Example for you
Code:
var dlgOpen:TOpenDialog;

..

if dlgOpen.Execute   // CMDialog.Filename <> "" 
   then CopyFile(dlgOpen.FileName,..);

Tell us if you have any results
Regards,
Spent
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top