Registriert seit: 6. Apr 2011
Ort: Berlin
3.070 Beiträge
Delphi 10.4 Sydney
|
AW: Record zum Teil als Konstante und Variable?
3. Apr 2020, 10:20
Ja.
Delphi-Quellcode:
program Project1;
{$APPTYPE CONSOLE}
{$R *.res}
uses
System.SysUtils;
type
TmyRecord = record
var
String_1: String;
String_2: String;
const
Boolean1: Boolean = True;
Boolean2: Boolean = False;
Boolean3: Boolean = True;
end;
var
FooBar: TmyRecord;
begin
try
FooBar.String_1 := ' Hello';
FooBar.String_2 := ' World!';
Writeln(FooBar.String_1, ' ', FooBar.String_2, ' ', FooBar.Boolean1, ' ', FooBar.Boolean2, ' ', FooBar.Boolean3);
except
on E: Exception do
Writeln(E.ClassName, ' : ', E. Message);
end;
Readln;
end.
|
|
Zitat
|