Solved

Unknown Identifier error

Posted on 1997-10-21
4
404 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
  • 2
4 Comments
 
LVL 5

Expert Comment

by:JimBob091197
Comment Utility
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
Comment Utility
 Exactly.
0
 

Author Comment

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

Shawn Halfpenny
0
 
LVL 5

Accepted Solution

by:
JimBob091197 earned 50 total points
Comment Utility
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

763 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

10 Experts available now in Live!

Get 1:1 Help Now