Solved

TIniFile

Posted on 1997-11-18
7
723 Views
Last Modified: 2008-03-17
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
Comment
Question by:lizzzard
7 Comments
 
LVL 4

Expert Comment

by:itamar
ID: 1350841
We need some code...
0
 
LVL 2

Expert Comment

by:rigansen
ID: 1350842
Show us your code!!
0
 
LVL 5

Expert Comment

by:JimBob091197
ID: 1350843
Have you created your TStringList?  You need to create it before calling ReadSectionValues.

JB
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 5

Accepted Solution

by:
ronit051397 earned 50 total points
ID: 1350844
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
 
LVL 5

Expert Comment

by:JimBob091197
ID: 1350845
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
 

Author Comment

by:lizzzard
ID: 1350846
Er...I DID forget to use the .create method. Sorry,that was too smart...
Thanks for your kindness...
0
 

Author Comment

by:lizzzard
ID: 1350847
Er...I DID forget to use the .create method. Sorry,that wasn't too smart...
Thanks for your kindness...
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now