Solved

TIniFile

Posted on 1997-11-18
7
733 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
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!

 
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

Independent Software Vendors: 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!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Run video youtube webbrowse 10 85
Create a path if not exists 7 124
Firemonkey webbrowser scrollbars ? 1 68
Firemonkey Listview item popup menu ? 1 72
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

737 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