Try this:
begin
Memo1.Lines.SaveToFile(ExtractFilePath(Application.ExeName) + 'SQL.ini');
end;
--
JAM - Relįjate y disfruta...
Andy
--
Kyoto Now !
> tw wrote:
>
>> I can't get this to loop around and write all the lines in the memo ,
>> all I
>> get is the last line of text in the memo?
>> Var
>> Ini: TiniFile;
>> I:integer;
>> Begin
>> Ini := Tinifile.create(ExtractFilePath(application.exename) + 'SQL.ini');
>> Try
>> for I:=0 to Memo1.Lines.Count-1 do begin
>> ini.writestring(DateTimeToStr(Now),'Line[I]' , Memo1.lines.Strings[I]);
>> end;
>> Finally
>> ini.free;
>> end;
>>
>>
>>
Sorry for the above:
Var
Ini: TiniFile;
I:integer;
begin
Ini := TIniFile.Create(ExtractFilePath(Application.ExeName) +
'SQL.ini');
try
for I:=0 to Memo1.Lines.Count-1 do
Ini.WriteString(DateTimeToStr(Now),'Line[' + IntToStr(I) + ']' ,
Memo1.Lines[I]);
finally
Ini.Free;
end;
end;
--
JAM - Relájate y disfruta...
>I can't get this to loop around and write all the lines in the memo , all I
>get is the last line of text in the memo?
If you end up with a lot of text in your memo for some
reason you might consider just putting the name of the
file in a key in the .ini file and using the SaveToFile perhaps
to save the memo in your app's folder. I think in Win9x the
.ini files stop working after a certain size(may be 32K but
I could be wrong.)
Mike
--
"Only choice is an oxymoron."
--