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

  • Home
  • SEARCH
  • 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 8345383
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T06:39:26+00:00 2026-06-09T06:39:26+00:00

I get the Undeclared identifier in a pprocedure I created called submit. procedure submit;

  • 0

I get the “Undeclared identifier” in a pprocedure I created called submit.

procedure submit;
begin
if ebMain.Text='exit' then
fmMain.Close;
end;

Really simple. The compiler tells me ebMain is undeclared. I ca fix this by putting “fmMain.” in front of it but I never had to do this in delphi 7.The edit box(ebMain) is on the main form(fmMain). The procedure header is placed just under the “uses”. What’s wrong?

  • 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-06-09T06:39:27+00:00Added an answer on June 9, 2026 at 6:39 am

    submit() is not a member of your TfrmMain class, so it does not know what ebMain is. You need to either:

    1) make submit() be a member of your form’s class (which you should do anyway because all it is doing is accessing members of TfrmMain):

    procedure TfrmMain.submit; 
    begin 
      if ebMain.Text='exit' then 
        Close; 
    end; 
    
    procedure submit; 
    begin 
      frmMain.submit;
    end; 
    

    2) prefix ebMain with the form’s global frmMain variable (like you are already doing for Close()):

    procedure submit; 
    begin 
      if frmMain.ebMain.Text='exit' then 
        fmMain.Close; 
    end; 
    

    Yes, you would have had to do this in every version of Delphi, including D7.

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

Sidebar

Related Questions

Why do I get this error message with this code? Use of undeclared identifier
Why won't my simple c++ code compile? get undeclared identifier errors. I can't see
I get error TryEnterCriticalSection undeclared identifier during compilation. Visual studio knows about the function
I can't figure out why I get use of undeclared identifier _cmd did you
I get Use of undeclared identifier 'data' when I compile that code. As you
I get Use of undeclared identifier 'NSLineBreakByWordWrapping' on xCode 4.3.3 which doesn't appear on
error C2065: 'exam1' : undeclared identifier // basic file operations #include <iostream> #include <fstream>
procedure questiontype; begin writeln ('Enter the type of question you would like...'); writeln ('1.
I am getting a use of undeclared identifier error in my json but I
Getting this error: (68): error C2065: 'programend' : undeclared identifier (Off-topic note: I know

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.