Einzelnen Beitrag anzeigen

DieDolly

Registriert seit: 22. Jun 2018
2.175 Beiträge
 
#1

TMeinSet(Byte(1)) in Variable > ungültige Typumwandlung

  Alt 4. Jun 2019, 13:14
Seit Jahren mache ich das so aber jetzt funktioniert es nicht mehr. Eine ungültige Typumwandlung. Aber wo?
Was ist daran denn falsch? Das sind so wenige Zeilen das gibts doch nicht.

Weiß jemand weiter?

Delphi-Quellcode:
type
 TGroups = (g1, g2, g3);
 TGroupSet = set of TGroups;

var
 GroupSet: TGroupSet;
begin
 GroupSet := TGroupSet(Byte(2));
Komplettes Konsolenbeispiel
Delphi-Quellcode:
program Project1;

{$APPTYPE CONSOLE}
{$R *.res}

uses
 System.SysUtils;

type
 TGroups = (g1, g2, g3);
 TGroupSet = set of TGroups;


var
 GroupSet: TGroupSet;

begin
 GroupSet := TGroupSet(Byte(2));
end.

Geändert von DieDolly ( 4. Jun 2019 um 15:11 Uhr)
  Mit Zitat antworten Zitat