Solved

INIFILE Win2000 Delphi5

Posted on 2001-07-16
2
565 Views
Last Modified: 2010-04-04
I have :
/////////
 IniFile:TIniFile;
 RepFileChoices : TStrings;
 sTemp:string;
begin
  IniFile:= TIniFile.Create  ('h:u\mbarron\adt_report\ADT_Report.ini');
  RepFileChoices:=TStrings.Create;
  IniFile.ReadSection('Reports',RepFileChoices);// errorline
  sTemp:= RepFileChoices[0];
\\\\\\\\\\\
INIFILE Follows
////////
[Reports]
Main=Yes
TotalTime=Yes
IwTime=No
Function=Yes
\\\\\
I get an error on execution of the next to last
line above. "EAbstractError"
Q1: Is the problem Wn2000?
q2: should I be using Registry? Understand
registry, but do not its usage in Delphi.
0
Comment
Question by:mebarron
2 Comments
 
LVL 2

Expert Comment

by:egono
ID: 6286764
IniFile:= TIniFile.Create  ('h:u\mbarron\adt_report\ADT_Report.ini');

this line seems to be wrong, maybe you meant:

IniFile:= TIniFile.Create  ('h:\umbarron\adt_report\ADT_Report.ini');


good luck

0
 
LVL 26

Accepted Solution

by:
Russell Libby earned 25 total points
ID: 6286903

The EAbstractError comes from the fact that the TIniFile.ReadSection() ends up calling TStrings.Add, which calls TStrings.GetCount, which is defined as abstract. (in classes.pas)

Use TStringList in place of the TStrings. TStringList has overriden the abstract methods in TStrings.

Russell
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

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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

895 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

18 Experts available now in Live!

Get 1:1 Help Now