Solved

Error E2158 compiling with Delphi XE10 Seattle

Posted on 2016-10-15
2
45 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 32

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

707 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now