Solved

INIFILE Win2000 Delphi5

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone 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

Suggested Solutions

Title # Comments Views Activity
can't find the executable in Simulator 1 100
Dynamically Created Query 3 62
update joined tables 2 55
Breakpoint doesn't stop in my variable 3 30
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

860 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