?
Solved

TIniFile

Posted on 1997-11-18
7
Medium Priority
?
741 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 5

Accepted Solution

by:
ronit051397 earned 150 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses
Course of the Month11 days, 22 hours left to enroll

752 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