Hi Paul

Yes I thought it was that basic, but it doesn't work for me. :-(

Some code snippets from MainForm.pas:

type
  TMainForm = class(TForm)
    UV: TUVObjects;
...
procedure TMainForm.UpdateWMS(PolNum: string);
...
  NewCorrKey := WriteNewCorrRecord(Sender,CORR,CORI,PolNum);   // this calls
DatabaseUtils.pas

Code from DatabaseUtils.pas:

function WriteNewCorrRecord(Sender: TObject; CORR, CORI: integer; PolNum:
string): string;
begin
  if  Sender.UV.ReadRecord(CORI,PolNum) then...

When doing a syntax check, it doesn't recognise UV in this unit. If I type
"Sender." and look at the list that comes up, it's not the same as if I type
"MainForm." when in the originating form.

I know I'm displaying my complete ignorance, but I want to learn. Should I
pass MainForm in the place of Sender (that didn't seem to work either).
Please note that the calling form may have some completely different name.

Thanks for any ideas.

Dave


-----Original Message-----
From: Paul Mckenzie [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 26 February 2003 10:24
To: Multiple recipients of list delphi
Subject: Re: [DUG]: How do I refer back to a calling form?


pass a "Sender" parameter

Regards
Paul McKenzie
Analyst Programmer
SMSS ltd.

----- Original Message -----
From: <[EMAIL PROTECTED]>
To: "Multiple recipients of list delphi" <[EMAIL PROTECTED]>
Sent: Wednesday, February 26, 2003 10:07 AM
Subject: [DUG]: How do I refer back to a calling form?


> Hi everyone
>
> I have a form (MainForm) which calls a function in a unit I'm creating,
> called DatabaseUtils. I want this unit to be able to have access to the
> public variables etc. of the calling form, without needing to hardcode
into
> the DatabaseUtils unit, "uses MainForm". Any form could have called my new
> unit. So how do I give my unit, access to the calling form?
>
> Thanks for any advice.
>
> Dave Jollie
> Software Developer BOA IT
> 09 368 4259 ext 6231
>
> The information contained in this mail message is confidential and may
also
> be legally privileged. If you are not the intended recipient, please note
> that any use, dissemination, further distribution, or reproduction of this
> message in any form what so ever, is strictly prohibited.  If the mail is
in
> error, please notify me by return E-mail, delete your copy of the message,
> and accept my apologies for any inconvenience caused.
>
> --------------------------------------------------------------------------
-
>     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
> To UnSub, send email to: [EMAIL PROTECTED]
> with body of "unsubscribe delphi"
> Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/


---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/

Reply via email to