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

  • SEARCH
  • Home
  • 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 8889441
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T22:15:49+00:00 2026-06-14T22:15:49+00:00

Hello i get error E2197: [DCC Error] proj1.pas(34): E2197 Constant object cannot be passed

  • 0

Hello i get error E2197: [DCC Error] proj1.pas(34): E2197 Constant object cannot be passed as var parameter:

unit proj1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, AdvEdit;

type
  TForm1 = class(TForm)
    AdvEdit1: TAdvEdit;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure SetEditText(const instr: string; out outstr: string);
begin
  outstr := instr;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  SetEditText('Pippo', AdvEdit1.Text);
end;

end.

Of course, i can solve writing:

procedure TForm1.Button1Click(Sender: TObject);
var sText: string
begin
  SetEditText('Pippo', sText);
  AdvEdit1.Text := sText;
end;

But when i have many AdvEdit, then it is hard. Then i ask, is possible solve the problem in some mode giving directly TAdvEdit.Text as parameter in mine procedure?
Thanks very much.

  • 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-14T22:15:51+00:00Added an answer on June 14, 2026 at 10:15 pm

    I presume that Text is a property. And you cannot pass a property to a var or out parameter. You can only pass variables to parameters of those kinds.

    You’ll need to find a different way to write your code. You’ve come up with one such idea, but it seems needlessly complex to me. I cannot see anything simpler than:

    AdvEdit1.Text := 'Pippo';
    

    How could there be any code simpler than this? You need to specify at a bare minimum the following:

    • The target control.
    • That we are dealing with the Text property.
    • The fact that we are assigning.
    • The new value.

    The code above does that and nothing more.

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

Sidebar

Related Questions

Hello I get a weird error in this code: function validateForm(aform) { var s=;
Hello I get this error when I do cap deploy:cold. * executing cd /var/www/myapp.no/releases/20100905130830;
I tried running a python script: print Hello, World! And I get this error:
Why do I get a syntax error from print "Hello World" in Python 3.2?
Hello not sure why Im getting this error. Basically I get it in these
Hello I get the Lvalue required as left operand of assignment error in xcode.
Hello i get this error in Android 3.2 and it doesn't point to my
I have a simple test program that when I run I get: ./hello: error
I get the error message Error: 'start.0' is null or not an object while
Hello I get this error every time I'm trying to open an activity java.lang.VerifyError:

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.