?
Solved

Unknown Identifier error

Posted on 1997-10-21
4
Medium Priority
?
422 Views
Last Modified: 2012-05-04
Hello..
  In my Unit, I can refer to my CheckBox1 field in my TForm1.BitBtn1Click procedure, but when I try to refer to CheckBox1 in another little procedure I just created (ie. procedure do_remove), I get Error 3: Unknown Identifier when I compile. Why? I checked the declarations and CheckBox1 is indeed declared as CheckBox1:TCheckBox. What is happenning here?

Cheers
    Shawn Halfpenny
    drumme59@sprint.ca
0
Comment
Question by:aztec
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 5

Expert Comment

by:JimBob091197
ID: 1348536
Hi

Your procedure Do_Remove must either be part of your form or must refer to your form.
E.g. As part of your form:
Add "procedure Do_Remove;" to your form's public section at the top of your unit.
Then add the code for Do_Remove as follows in the implementation section of your unit:
procedure TForm1.Do_Remove;
begin
    etc.
end;

E.g. Referring to your form:
procedure Do_Remove;
begin
    Form1.CheckBox1.Checked := True;
end;

JB
0
 
LVL 4

Expert Comment

by:StevenB
ID: 1348537
 Exactly.
0
 

Author Comment

by:aztec
ID: 1348538
I like JimBob's response, so go ahead and use that as the answer.

Shawn Halfpenny
0
 
LVL 5

Accepted Solution

by:
JimBob091197 earned 100 total points
ID: 1348539
I guess this is the answer then.

JB

P.S.  Your other question's points went to dvaline, despite your comment that you prefered my answer.  Just thought I'd let you know.  It's not a problem though...   ;-)
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses
Course of the Month13 days, 21 hours left to enroll

800 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