Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6729033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:14:26+00:00 2026-05-26T10:14:26+00:00

If the question seems vague or confusing, I apologize. This is for Delphi Prism

  • 0

If the question seems vague or confusing, I apologize. This is for Delphi Prism .NET.

I have a base class with a variable called bounds of type rectangle. From this class another class derives or inherits and has access to base class variable bounds. During design time, compiler recognizes bounds variable from base class, but during debug-time it keeps raising unknown error for the variable bounds in base class. So, my program compiles successfully but fails to run correctly.

Here is the base class and the variable:

  TControlObject = public class
    bounds:Rectangle;     <<=========This is the Variable in question
  private
  protected
  public
  end; 

Here is the derived class:

  TGateControl = class(TControlObject)
    fInputCount:SmallInt;
  private
  protected
  public
    constructor (theForm:Form);
  end;

Here is the constructor for the derived class with the base class variable:

constructor TGateControl(theForm:Form);
begin
  inherited constructor(theForm);
  fInputCount := 2;
  bounds.width := bounds.Right-(bounds.left+(4 * CGridSize)); <<=======Here is where unknown identifier error is raised for bounds variable.
  bounds.Height := bounds.Bottom-(bounds.top+(3 * CGridSize));<<=======Here is where unknown identifier error is raised for bounds variable.
end;

What am I doing wrong?
Thanks,

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T10:14:26+00:00Added an answer on May 26, 2026 at 10:14 am

    You need to declare the variable in the protected section of the class to make it visible to derived classes. When you declare it without explicitely stating the visibility, it is assumed that you wanted to make it private and a private field is not visible to derived classes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This question seems to have been asked a lot, but I haven't seen an
I apologize in advance if this question seems remedial. Which would be considered more
I apologize in advance if this question seems confused. The behaviour I am seeing
Actually, this question seems to have two parts: How to implement pattern matching? How
the question title seems pretty confusing, but this is what i want to achieve.
I have a small question which is confusing me, I have a variable of
This is a pretty vague question and getting it answered seems like a long
This question seems to be the essence of several others on this forum. I
This question seems to be asked freqeuently over the internet but I still can't
The question seems pretty well formulated I have a virtual machine which implements only

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.