Solved

Error E2158 compiling with Delphi XE10 Seattle

Posted on 2016-10-15
2
112 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
2 Comments
 
LVL 33

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
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 use and create keystrokes in Netbeans IDE 8.0 for Windows.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

861 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