Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.pascal.delphi.misc > #640

Re: Undeclared identifier error getting.

Newsgroups comp.lang.pascal.delphi.misc
Date 2014-09-30 04:23 -0700
References <49495c98-6639-46b0-9d55-48ea0e28404a@googlegroups.com> <c8vbrbFq1b7U1@mid.individual.net> <c87051c7-a577-46f7-b235-6d88ec921fae@googlegroups.com>
Message-ID <6f2cc906-3d00-4216-b732-e8d0e04fa298@googlegroups.com> (permalink)
Subject Re: Undeclared identifier error getting.
From Sandeepan Kashyap <sandeepan1982@gmail.com>

Show all headers | View raw


On Tuesday, September 30, 2014 3:56:11 PM UTC+5:30, Sandeepan Kashyap wrote:
> Thanks JJ and DoDi for your valuable inputs.I tried as suggested, but still no success.
> 
> 
> 
> unit stringcheck;
> 
> interface
> 
> implementation
> 
> {$R *.RES}
> 
> 
> 
> uses sysutils ,StrUtils, Demographics;
> 
> type
> 
>      TSharedFunctions1 = class
> 
>     private
> 
>     { Private declarations }
> 
>     public
> 
>       function DoSomething: string;
> 
>     end;
> 
> var
> 
>   ......
> 
> 
> 
> On Tuesday, September 30, 2014 3:05:40 PM UTC+5:30, Hans-Peter Diettrich wrote:
> 
> > Sandeepan Kashyap schrieb:
> 
> > 
> 
> > > Hi,
> 
> > 
> 
> > > 
> 
> > 
> 
> > > we are trying to access a function DoSomething() of unit stringcheck from unit Demographics . While running, we are getting 'Undeclared identifier: 'TSharedFunctions1' error, not sure why? though we have used the unit in main Unit.
> 
> > 
> 
> > > Any ideas will be greatly appreciated.
> 
> > 
> 
> > > 
> 
> > 
> 
> > > unit stringcheck;
> 
> > 
> 
> > > interface
> 
> > 
> 
> > > implementation
> 
> > 
> 
> > >        {$R *.RES}
> 
> > 
> 
> > > uses sysutils ,StrUtils;
> 
> > 
> 
> > > type
> 
> > 
> 
> > >   TSharedFunctions1 = class
> 
> > 
> 
> > 
> 
> > 
> 
> > Whatever shall be visible in other units must reside between "interface" 
> 
> > 
> 
> > and "implementation". Just like in Demographics...
> 
> > 
> 
> > 
> 
> > 
> 
> > DoDi

Ok, I tried below, past error has gone, but now I am getting error in Demographics form (main form):
[Error] Demographics.pas(50): This form of method call only allowed for class methods


unit stringcheck;
interface
type
    TSharedFunctions1 = class
    private
    { Private declarations }
    public
      function DoSomething: string;
    end;
implementation
       {$R *.RES}
uses sysutils ,StrUtils;
_____________
Demographics form (main form):

procedure TForm2.Button1Click(Sender: TObject);
begin
  ShowMessage('tetss-'+ TSharedFunctions1.DoSomething());  //getting error This form of method call only allowed for class methods
end;

Back to comp.lang.pascal.delphi.misc | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Undeclared identifier error getting. Sandeepan Kashyap <sandeepan1982@gmail.com> - 2014-09-30 00:15 -0700
  Re: Undeclared identifier error getting. JJ <jj4public@vfemail.net> - 2014-09-30 16:31 +0700
  Re: Undeclared identifier error getting. Hans-Peter Diettrich <DrDiettrich1@aol.com> - 2014-09-30 11:23 +0200
    Re: Undeclared identifier error getting. Sandeepan Kashyap <sandeepan1982@gmail.com> - 2014-09-30 03:26 -0700
      Re: Undeclared identifier error getting. Sandeepan Kashyap <sandeepan1982@gmail.com> - 2014-09-30 04:23 -0700
        Re: Undeclared identifier error getting. Hans-Peter Diettrich <DrDiettrich1@aol.com> - 2014-09-30 16:31 +0200
  Re: Undeclared identifier error getting. "Alan Lloyd" <alanglloyd@NotThisBitbtinternet.com> - 2014-10-05 19:26 +0100
    Re: Undeclared identifier error getting. Sandeepan Kashyap <sandeepan1982@gmail.com> - 2014-10-07 04:41 -0700

csiph-web