Re: A compile problem or a conceptual one

From: Bruce Roberts (ber_at_bounceitattcanada.xnet)
Date: 11/28/03


Date: Thu, 27 Nov 2003 18:04:52 -0500


"Stark" <starkwedder@virgilio.it> wrote in message
news:Uyuxb.17736$AX1.690847@news1.tin.it...
> I moved a proc from one module to another and I cannot compile it anymore.
I
> don't understand why. It fails with the message "Undefined identifier
Self"
> in the following statement:
> NewItem := TMenuItem.Create(Self);
> The unit where the proc used to be was a form with a TMenu as a component,
> while the unit where the proc was moved is a unit with no form (where I
keep
> more general routines), so I suspect that the problem has something to do
> with this.

Read the ObjectPascal (Delphi) Language Reference. In particular note the
difference between a Procedure and a Method.

Self is only valid in methods.

Alter your procedure to take a parameter that replaces Self.



Relevant Pages

  • Re: PROBLEM: pthread-safety bug in write(2) on Linux 2.6.x
    ... the pipe guarantees atomicity. ... Proc 0 read 8174 bytes ... As shown, linux completely fails. ... on a dual SMP system, ...
    (Linux-Kernel)
  • A compile problem or a conceptual one
    ... I moved a proc from one module to another and I cannot compile it anymore. ... It fails with the message "Undefined identifier Self" ...
    (comp.lang.pascal.delphi.misc)
  • using TCL with sqlite database...
    ... I'm trying to access an SQLite database via TCL. ... Creating/opening/create tables etc. succeeds when doing it in 1 procedure, ... but fails when I open the db in proc open_sqlite_db and try to write ...
    (comp.lang.tcl)
  • Re: Electrohome T.V.!!
    ... Electrohome is out of Biz. ... anymore, and i doubt you'll be able to get a stereo, proc IC ...
    (sci.electronics.repair)
  • Re: T.V. Electrohome !!
    ... Electrohome is out of Biz. ... anymore, and i doubt you'll be able to get a stereo, proc IC. ...
    (sci.electronics.repair)