Jayz
ISP
- Feb 17, 2002
- 59
Ok, I know this sounds simple but I'm new to Delphi and I hope this will be easy to understand.
I currently have 2 combo boxes with the values 60, 120, 240 in cmbox1 and 0, 10, 12 in cmbox2.
I want to be able to open a txt file and replace certain text in that file with the value from the combo boxes. And then save it as a batch file
Here is my current code:
//=====================
var
L:TStringList;
procedure TForm1.saveClick(Sender: TObject);
begin
L := TStringList.create;
L.loadfromfile('c:\template\btchmultiplex.txt');
L.text := StringReplace(L.text,'%1','160',[rfReplaceAll]);
L.text := StringReplace(L.text,'%2','12',[rfReplaceAll]);
L.savetofile('c:\template\yahoo.bat');
L.free;
end;
//===============================
I want to replace '%1' with a value from cmbobx1
I want to replace '%2' with a value from cmbobx2
Your help would be much appreciated.
I currently have 2 combo boxes with the values 60, 120, 240 in cmbox1 and 0, 10, 12 in cmbox2.
I want to be able to open a txt file and replace certain text in that file with the value from the combo boxes. And then save it as a batch file
Here is my current code:
//=====================
var
L:TStringList;
procedure TForm1.saveClick(Sender: TObject);
begin
L := TStringList.create;
L.loadfromfile('c:\template\btchmultiplex.txt');
L.text := StringReplace(L.text,'%1','160',[rfReplaceAll]);
L.text := StringReplace(L.text,'%2','12',[rfReplaceAll]);
L.savetofile('c:\template\yahoo.bat');
L.free;
end;
//===============================
I want to replace '%1' with a value from cmbobx1
I want to replace '%2' with a value from cmbobx2
Your help would be much appreciated.