Avatar of WRieder
WRieder
Flag for South Africa asked on

Problem with Delphi 10.3.3 (Rio)

It appears that this Version of Delphi has removed access to private Fields.
JvFormStorage produces an AccessViolation when trying to exctract Sections.

Code Snippet:

function TMemIniFileHelper.ValueExists(const Section, Ident: string): Boolean;
var
  I: Integer;
  Strings: TStrings;
  Sections: TStringList;
begin
  {$IFDEF RTL310_UP} // 10.1 Berlin removed the access to private fields
  Sections := TMemIniFileAccess(Self).FSections;
  {$ELSE}
  Sections := Self.FSections;
  {$ENDIF RTL310_UP}
  I := Sections.IndexOf(Section);
  if I >= 0 then
  begin
    Strings := TStringList(Sections.Objects[I]);
    I := Strings.IndexOfName(Ident);
    Result := I >= 0;
  end else
    Result := False;
end;
Delphi

Avatar of undefined
Last Comment
WRieder

8/22/2022 - Mon
ste5an

Don't have access to this version, but it sounds like a visibility modifier problem. Check the TMemIniFileAccess class and its modifier in both your systems.

Otherwise it's intentional, see Closing the Class Helpers Private Access Loophole.

In this case it simply means, that you did something in the past, which simply wasn't correct, but allowed. So, when you need to access such a private member, then change the base class.
ASKER CERTIFIED SOLUTION
WRieder

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck