• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 751
  • Last Modified:

TIniFile

Hi,

I'm trying to use to ReadSectionValues Method of an Inifile object using a TStringList just as an example in the Delphi helpfile. But I'm getting a AccessViolation Error. What am I doing wrong?
0
lizzzard
Asked:
lizzzard
1 Solution
 
itamarCommented:
We need some code...
0
 
rigansenCommented:
Show us your code!!
0
 
JimBob091197Commented:
Have you created your TStringList?  You need to create it before calling ReadSectionValues.

JB
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
ronit051397Commented:
probably you didn't call the 'create' method for one of the objects. Place a button and a memo and try the following which works:

uses Inifiles;
...
procedure TForm1.Button1Click(Sender: TObject);
var xxx: TStringList;
begin
xxx:=TStringList.Create;
with tinifile.create('system.ini') do
begin
  ReadsectionValues('Boot', xxx);
  Free;
end;
Memo1.Lines:=xxx;
xxx.Free;
end;

0
 
JimBob091197Commented:
Why, isn't that what I said???  You would think a guy would know how to call "MyStrList := TStringList.Create;" once he knew that was the problem...
0
 
lizzzardAuthor Commented:
Er...I DID forget to use the .create method. Sorry,that was too smart...
Thanks for your kindness...
0
 
lizzzardAuthor Commented:
Er...I DID forget to use the .create method. Sorry,that wasn't too smart...
Thanks for your kindness...
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now