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 6378031
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:57:06+00:00 2026-05-25T01:57:06+00:00

is it possible to pass nil as an undeclared constant to the untyped parameter

  • 0

is it possible to pass nil as an undeclared constant to the untyped parameter of some function?
I have functions like these and I would like to pass some constant to the Data parameter to satisfy the compiler. Internally I’m deciding by the Size parameter. I know I can use Pointer instead of untyped parameter but it’s much more comfortable for my case.

Now I’m getting E2250 There is no overloaded version of 'RS232_SendCommand' that can be called with these arguments

function RS232_SendCommand(const Command: Integer): Boolean; overload;
begin
  // is it possible to pass here an undeclared constant like nil in this example?
  Result := RS232_SendCommand(Command, nil, 0);
end;

function RS232_SendCommand(const Command: Integer; const Data; const Size: Integer): Boolean; overload;
begin
  ...
end;

This works, but I would be glad if I could leave the variable declaration.

function RS232_SendCommand(const Command: Integer): Boolean; overload;
var
  Nothing: Pointer;
begin
  Result := RS232_SendCommand(Command, Nothing, 0);
end;

Solution is to use somthing like this.

function RS232_SendCommand(const Command: Integer): Boolean; overload;
begin
  // as the best way looks for me from the accepted answer to use this
  Result := RS232_SendCommand(Command, nil^, 0);

  // or it also possible to pass an empty string constant to the untyped parameter
  // without declaring any variable
  Result := RS232_SendCommand(Command, '', 0);
end;

I’m doing this because some of my commands have a data sent after command transmission.

Thanks for the help

  • 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-05-25T01:57:07+00:00Added an answer on May 25, 2026 at 1:57 am

    Easy:

    RS232_SendCommand(Command, nil^, 0);
    

    You just need to make sure that you don’t access the Data parameter from inside RS232_SendCommand, but presumably that’s what the 0 size parameter is for.

    To my mind this is the best solution because it very explicitly states that you are passing something that cannot be accessed.

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

Sidebar

Related Questions

Is it possible to pass some variables to the called function, it tried it
I would like to pass a NSArray containing NSstrings to NSURLRequest, is it possible
Is possible to pass the element to the focusout function in Jquery? I would
Possible Duplicate: pass by reference not working I was going through some of the
Is it possible to pass the coloumn name also like a variable.Please edit this
It is possible to pass 2d array to a function as a paramter ?
Is possible to pass type as param in SQL function? thank in advance.
Is it possible to pass a reference to a function to another function in
Is it possible to pass a parameter into a CTE that selects a node
Is it possible to pass a list constructor parameter when resolving a type? I

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.