Jump to content
Sign in to follow this  
BertB

Delphi 12.0 - Cannot find implementation of method ... - Multiline Strings

Recommended Posts

In Delphi 12.0 multi line strings (as described in https://blog.marcocantu.com/blog/2023-09-yukonbeta-stringliterals.html) can cause error message 'Cannot find implementation of method ...' when clicking on a control.

Add a new form to your application, add a Button.

implementation

{$R *.dfm}

procedure TForm1.Test;
var
  Query: string;
begin
  Query := '''
    SELECT COUNT(*) FROM test
    ''';
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  //
end;

Procedure Test is private. The code compiles and runs as expected but during design time it caused me a little headache.

It turns out that CodeInsight (or something else) is treating '(*' as the start of a comment.

Change the SQL statement to

  SELECT COUNT ( *) FROM test

Double clicking on the Button now finds its implementation.

Just wondering it this has already been fixed in version 12.1.

Share this post


Link to post

No, it is not.

 

It also breaks the deprecated code formatter. Unfortunately, we must wait until Delphi 15 to use this new feature.

Edited by Lajos Juhász
Added remark on code formatter.
  • Haha 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×