Link to home
Start Free TrialLog in
Avatar of tinti
tinti

asked on

text file

I have a combobox with some names
a button below
i want when i select a name from combo and push the button
to create me in C:\Temp a new empty text file with the name from the combo
ex if the selected name is John Mark create C:\Temp\John Mark.txt
Thanks
ASKER CERTIFIED SOLUTION
Avatar of rvicentiu
rvicentiu

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ThoseBug
ThoseBug

procedure TForm1.Button1Click(Sender: TObject);
var
  FileHandle: Integer;
begin
  FileHandle := FileCreate('c:\temp\'+combobox1.text);
  if FileHandle<0 then showmessage('create file error')
end;
//uupps  add '.txt'

procedure TForm1.Button1Click(Sender: TObject);
var
  FileHandle: Integer;
begin
  FileHandle := FileCreate('c:\temp\'+combobox1.text+'.txt');
  if FileHandle<0 then showmessage('create file error')
end;
end.