Can anyone help me with a little delphi code?

T

TheJkWhoSaysNi

Guest
I have this code that copies 1 file to another, with an editbox so you can specify the new filename heres what i have...
F.pFrom := 'A:\File.txt';
F.pTo := 'C:\' + NameEdit.Text + '.txt';
Why wont that work? it gives me an error on the To line...

Thanks for any help...
 
S

(Shovel)

Guest
Can you put in what the exact error is?

I sometimes find (though beyond my understanding) that it can help to stick the form name in before any objects.
e.g.
Code:
F.pFrom := 'A:\File.txt';
F.pTo := 'C:\\' + frmMain.NameEdit.Text + '.txt';
 
F

FatBusinessman

Guest
This may just be me being stupid, but is it possible that it's misinterpreting the \' as an escape character? You could try putting in a double slash, see if that helps...
 

Users who are viewing this thread

Top Bottom