Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Delphi Konstante eines Records in Konstante eines Records verwenden (https://www.delphipraxis.net/133769-konstante-eines-records-konstante-eines-records-verwenden.html)

brechi 8. Mai 2009 09:33


Konstante eines Records in Konstante eines Records verwenden
 
Titel klingt bisl komisch, es ist aber folgendes gemeint:

Delphi-Quellcode:
type THallo = record
  a, b: Integer;
end;
const THuhu: THallo = (a: 1; b:2);

type TTest = record
  a: Integer;
  b: THallo;
end;

const TTest2: TTest = (a: 1; b: THuhu);
der Fehler tritt in TTest2 bei b: THuhu auf


Theoretisch möchte ich ein

TTest2 = (a:1; b: (a:1; b:2));

haben. Danke :)

himitsu 8. Mai 2009 09:44

Re: Konstante eines Records in Konstante eines Records verwe
 
scheint wohl nicht zu gehn :gruebel:

und nichmal das geht ... Hallo.a ist keine Konstante :nerd:
Delphi-Quellcode:
type THallo = record
  a, b: Integer;
end;

const Hallo: THallo = (a: 1; b: 2);

type TTest = record
  c: Integer;
  d: THallo;
end;

const Test: TTest = (c: 1; d: (a: Hallo.a; b: Hallo.b));


Alle Zeitangaben in WEZ +1. Es ist jetzt 07:43 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