Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Error E2158 compiling with Delphi XE10 Seattle

Posted on 2016-10-15
2
Medium Priority
?
193 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 35

Accepted Solution

by:
sarabande earned 2000 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
Suggested Courses

721 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