Solved

Error E2158 compiling with Delphi XE10 Seattle

Posted on 2016-10-15
2
140 Views
Last Modified: 2016-10-16
I use the function SetLength at several places in one Delphi application, without any compilation errors
Now I add something like this :

procedure MyProc(var M:array of string);
begin
.../...
SetLength(M,0);
.../...
end;

and get E2158 System unit out of date or corrupted : missing @Clr !!!
0
Comment
Question by:LeTay
[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
2 Comments
 
LVL 34

Accepted Solution

by:
sarabande earned 500 total points
ID: 41845617
var M:array of string
don't know much about pascal but would guess that the array passed was by reference. if so, it can't be shrinked (to 0 or at all) in case it is allocated on the stack. you may try to pass a dynamic array instead.

Sara
0
 

Author Closing Comment

by:LeTay
ID: 41845693
Indeed, looks to be that
I used a workaround that ... works !
I defined

TRecArray = record
  Elements:array of string;

procedure MyProc (var M:TRecArray);
begin
.../...
  SetLength(M.Elements,0);
.../...
end;

Works !
0

Featured Post

Technology Partners: 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!

Question has a verified solution.

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

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

732 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