Danil Lavrentiuck mentioned this to Gary Weinfurther:
>>>> S1.LoadFromFile(F); <- Here i have ErroR "EAccessViolation"
DL> But why the error message is so obscure? Why TString don't handle this
DL> illegal operation?
Because LoadFromFile is abstract in TStrings. It doesn't exist.
GW>> IniFile := TIniFile.Create('some.ini');
GW>> try
GW>> Value := IniFile.ReadString('Section', 'Key', 'DefaultValue');
GW>> finally
GW>> IniFile.Free;
GW>> end;
DL> It's not a solution. He needs to get a list of all keys in section. Work
DL> with single key - is a wrong way.
There are many ways to accomplish this, including TIniFile.ReadSection. If
you browse the help files, you can discover a lot of interesting things. One
thing I've found about Delphi: There's always an easy way to accomplish
something. Granted, finding out what that easy way is, is not always easy.
...Gary
--- GoldED 2.41
---------------
* Origin: The Flying Circus BBS, Farmington Hills, MI. (1:2410/905)
|