Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9045277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T11:15:04+00:00 2026-06-16T11:15:04+00:00

I have two Equal method that take these overloads: TVariantExpression = reference to function():

  • 0

I have two Equal method that take these overloads:

TVariantExpression = reference to function(): Variant;

function Equal(const value: Variant): TRuleBuilder; overload;
function Equal(expr: TVariantExpression): TRuleBuilder; overload;

suppose I have another function :

function TForm1.GetMagicNumber: Variant;
begin
  Result := 10;
end;

and I invoke function like this:

Equal(Form1.GetMagicNumber);

After inspecting, I get result that second overload is called. Why? because both of them is valid to be called.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T11:15:11+00:00Added an answer on June 16, 2026 at 11:15 am
    Form1.GetMagicNumber
    

    is ambiguous. It can be either the function, or the value returned after executing the function. In most contexts, only one of those meanings is valid, and that meaning is chosen.

    In your code, either meaning is valid. In such a scenario the language rules mean that the procedural type interpretation is chosen.

    To force function invocation write:

    Form1.GetMagicNumber()
    

    This is a significant difference from most other languages, e.g. C, C++, C#, Java, Python etc. In those languages you must use parentheses in order to invoke a function.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two float variables that are equal, I retrieve them by PHP and
I have written two methods that take and return a string. One converts from
I have two matrices a and b (with equal number of columns). I want
I have two button name A, and B want to click them equal to
I have my own simple equal heights code in jQuery to make two columns
I have two enumerables with the exact same reference elements, and wondering why Equals
I am currently implementing a method that accepts two bitmap objects. We can assume
I have two classes A & B, and a listbox. I assign listBox.ItemsSource equal
From what I have understood, the equal method checks if the object is the
I have two arraylists, one contains Strings and the other contains Classes that have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.