![]() |
Record als Const?
Kann ich ein Record irgendwie als const definieren? :gruebel:
Das ist mein record oder besser Delphis Record :zwinker:
Delphi-Quellcode:
Nun will ich ne Konstante MyFS mit festen Werten haben...
type
TFormatSettings = record CurrencyFormat: Byte; NegCurrFormat: Byte; ThousandSeparator: Char; DecimalSeparator: Char; CurrencyDecimals: Byte; DateSeparator: Char; TimeSeparator: Char; ListSeparator: Char; CurrencyString: string; ShortDateFormat: string; LongDateFormat: string; TimeAMString: string; TimePMString: string; ShortTimeFormat: string; LongTimeFormat: string; ShortMonthNames: array[1..12] of string; LongMonthNames: array[1..12] of string; ShortDayNames: array[1..7] of string; LongDayNames: array[1..7] of string; TwoDigitYearCenturyWindow: Word; end; Tut das gehn? :?: Bye |
Re: Record als Const?
Hai Kadariodokon,
schaue mal in der Hilfe nach ![]()
Delphi-Quellcode:
type TmyTest = Record
blubb : String; foo : Integer; end; const myTest : TMyTest = (blubb:'hallo';foo:23); |
Re: Record als Const?
Delphi-Quellcode:
Dabei müssen nicht alle Felder auch vorbelegt werden.
MyFS: TFormatSettings = (
CurrencyFormat: 1; NegCurrFormat: 2; ThousandSeparator: ' ' // ...); Edit: Och menno, diese doofen Moderatoren, die kommen immer als erstes dran... ![]() |
Re: Record als Const?
Schon gefunden ^^
Bin heut zu pöd zum suchen...
Delphi-Quellcode:
Bye
Const
MyFS: TFormatSettings = ( CurrencyFormat: 3; NegCurrFormat: 8; ThousandSeparator: '.'; DecimalSeparator: ','; CurrencyDecimals: 2; DateSeparator: '.'; TimeSeparator: ':'; ListSeparator: ';'; CurrencyString: ''; ShortDateFormat: ''; LongDateFormat: ''; TimeAMString: ''; TimePMString: ''; ShortTimeFormat: ''; LongTimeFormat: ''; ShortMonthNames: ( '', '', '', '', '', '', '', '', '', '', '', ''); LongMonthNames: ( '', '', '', '', '', '', '', '', '', '', '', ''); ShortDayNames: ( '', '', '', '', '', '', '' ); LongDayNames: ( '', '', '', '', '', '', '' ); TwoDigitYearCenturyWindow: 2 ); |
Re: Record als Const?
Zitat:
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 11:54 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