[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

if (ButtonAccept.OnClick = ButtonAcceptClick) then ... Not enough parameters

Posted on 2003-11-07
7
Medium Priority
?
210 Views
Last Modified: 2010-04-05
At some point in my program I assign one of different available procedures to ButtonAccept.OnClick

I want to use that value in an if clause but when I use the code

 if (ButtonAccept.OnClick = ButtonAcceptClick)  then

then I get a compile error not enough parameter

0
Comment
Question by:moonrise
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 12

Expert Comment

by:andrewjb
ID: 9702869
without delphi to hand...

try @ButtonAcceptClick
or maybe ^ButtonAcceptClick

though I'm not sure.

If that don't work, try

  x : TNotifyEvent;

x = ButtonAcceptClick;

if ( ButtonAccept.OnClick = x ) then ....
0
 

Author Comment

by:moonrise
ID: 9703078
Tried all 3 suggestions, always the same error - not enough parameters and the cursor is positioned right after the =

strange...
0
 
LVL 12

Expert Comment

by:andrewjb
ID: 9703146
Ah - same for the onclick part.

So try

x : TNotifyEvent;
y : TNotifyEvent

x := ButtonAccept.OnClick;
y := ButtonAcceptClick;

if ( x = y ) then..
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:moonrise
ID: 9703170
same error
0
 
LVL 12

Expert Comment

by:andrewjb
ID: 9703185
Flippin 'eck. Hang on, then. Let's see if I can find a copy of Delphi...
0
 
LVL 12

Accepted Solution

by:
andrewjb earned 500 total points
ID: 9703239
OK - I was nearly right first time.

You need to use '@' to say ' the address of the function', otherwise it thinks you're trying to call it (which is what the 'not enough parameters' means)

So, back to your original,

instead of:

if (ButtonAccept.OnClick = ButtonAcceptClick)  then

you need

if (@ButtonAccept.OnClick = @ButtonAcceptClick)  then
0
 

Author Comment

by:moonrise
ID: 9703269
great, got a combination that works - your last one was very close, except that @ has to be used with a variable

  x : TNotifyEvent;

    x := ButtonAcceptClick;

if @ButtonAccept.OnClick = @x ....

thank you for your help
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

649 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