AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Record als Const?

Ein Thema von Kedariodakon · begonnen am 13. Jan 2005 · letzter Beitrag vom 13. Jan 2005
Antwort Antwort
Benutzerbild von Kedariodakon
Kedariodakon

Registriert seit: 10. Sep 2004
Ort: Mönchengladbach
833 Beiträge
 
Delphi 7 Enterprise
 
#1

Record als Const?

  Alt 13. Jan 2005, 11:14
Kann ich ein Record irgendwie als const definieren?

Das ist mein record oder besser Delphis Record
Delphi-Quellcode:
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;
Nun will ich ne Konstante MyFS mit festen Werten haben...
Tut das gehn?


Bye
Christian
  Mit Zitat antworten Zitat
Benutzerbild von Sharky
Sharky

Registriert seit: 29. Mai 2002
Ort: Frankfurt
8.251 Beiträge
 
Delphi 2006 Professional
 
#2

Re: Record als Const?

  Alt 13. Jan 2005, 11:21
Hai Kadariodokon,

schaue mal in der Hilfe nach Delphi-Referenz durchsuchenRecord-Konstanten
Delphi-Quellcode:
type TmyTest = Record
       blubb : String;
       foo : Integer;
     end;

const
  myTest : TMyTest = (blubb:'hallo';foo:23);
Stephan B.
"Lasst den Gänsen ihre Füßchen"
  Mit Zitat antworten Zitat
tommie-lie
(Gast)

n/a Beiträge
 
#3

Re: Record als Const?

  Alt 13. Jan 2005, 11:22
Delphi-Quellcode:
MyFS: TFormatSettings = (
  CurrencyFormat: 1;
  NegCurrFormat: 2;
  ThousandSeparator: ' '
  // ...);
Dabei müssen nicht alle Felder auch vorbelegt werden.


Edit: Och menno, diese doofen Moderatoren, die kommen immer als erstes dran... http://dpchat.dpexperte.de/smileys/icon_mecker.gif
  Mit Zitat antworten Zitat
Benutzerbild von Kedariodakon
Kedariodakon

Registriert seit: 10. Sep 2004
Ort: Mönchengladbach
833 Beiträge
 
Delphi 7 Enterprise
 
#4

Re: Record als Const?

  Alt 13. Jan 2005, 11:26
Schon gefunden ^^
Bin heut zu pöd zum suchen...

Delphi-Quellcode:
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 );
Bye
Christian
  Mit Zitat antworten Zitat
Robert Marquardt
(Gast)

n/a Beiträge
 
#5

Re: Record als Const?

  Alt 13. Jan 2005, 12:51
Zitat von Kedariodakon:
Bin heut zu pöd zum suchen...
Das mit der Rechtschreibung scheint auch nicht zu gehen
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 04:29 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