Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Delphi Array-Problem in Prozedur (https://www.delphipraxis.net/76948-array-problem-prozedur.html)

simlei 12. Sep 2006 14:53


Array-Problem in Prozedur
 
Delphi-Quellcode:
procedure sharpPath(var Path: array of TPt);
var i, k, newlength, letzter: integer;
{...}
begin
 {...}
 SetLength(Path, newlength);
 {...}
end;
In dieser Prozedur kam beim Compilieren der Fehler: Incompatible Types bei der SetLength-Zeile. Warum? uNd Wie kann ich es anders lösen wenn es prinzipiell nmicht geht?
schonmal danke für die zahlreichen Antworten :)

Hawkeye219 12. Sep 2006 15:02

Re: Array-Problem in Prozedur
 
Hallo simlei,

du mußt das Array als Typ vereinbaren:

Delphi-Quellcode:
type
  TPtArray = array of TPt;

procedure sharpPath(var Path: TPtArray);
Gruß Hawkeye

simlei 12. Sep 2006 15:53

Re: Array-Problem in Prozedur
 
Danke!


Alle Zeitangaben in WEZ +1. Es ist jetzt 17:35 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz