Solved

INIFILE Win2000 Delphi5

Posted on 2001-07-16
2
566 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

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

772 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