Solved

INIFILE Win2000 Delphi5

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

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…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
This video discusses moving either the default database or any database to a new volume.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

760 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