![]() |
Recordtyp initialisieren?
hoi,
wie kann ich einen recordtyp initialisieren? theoretisch dachte ich mir das so:
Delphi-Quellcode:
nun sollte jede variable diesen records den wert "hi" bereits haben. Wie geht das?
type tmyrec = record
teststring: string = 'hi'; end; |
Re: Recordtyp initialisieren?
Das geht leider nicht! bei globalen variablen kannst du aber einzelnd initialisieren:
Delphi-Quellcode:
[delphi]
type tmyrec = record
teststring: string; end; var y:tmyrec = (teststring:'hi'); viel mehr geht nicht :? |
Re: Recordtyp initialisieren?
Du könntest dir vielleicht ne KLasse schreiben und dann im Constructor machen was du willst.
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 10:33 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz