Solved

Unknown Identifier error

Posted on 1997-10-21
4
410 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
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 50 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

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…
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…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

776 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