Type ---gt; Como Fazer????
Como posso fazer algo parecido com isso:
Type Exemplo1 = (ex1, ex2, ex3);
Type Exemplo2 = Exemplo1 + (ex4, ex5, ex6);
Type Exemplo3 = Exemplo1 + (ex50, ex60, ex70);
Ou seja, eu quero ter uma variável enumerada padrão, e outras herdando a padrão e acrescentando mais valores.
Type Exemplo1 = (ex1, ex2, ex3);
Type Exemplo2 = Exemplo1 + (ex4, ex5, ex6);
Type Exemplo3 = Exemplo1 + (ex50, ex60, ex70);
Ou seja, eu quero ter uma variável enumerada padrão, e outras herdando a padrão e acrescentando mais valores.
Ronaldo
Curtidas 0
Respostas
Motta
18/12/2003
estou sem o delphi aqui nao lembro a sintaxe mas deve criar um type que é um set de outro type,
a prop style do TFont é uma caso típico, veja detalhes no help
creio que é assim
type TXpto set of integer;
a prop style do TFont é uma caso típico, veja detalhes no help
creio que é assim
type TXpto set of integer;
GOSTEI 0
Beppe
18/12/2003
Não. Isto seria herança, e herança só é permitida com classes no Delphi.
Para que você precisaria disso?
Para que você precisaria disso?
GOSTEI 0
Marcelo Saviski
18/12/2003
tem algum problam de fazer assim, Enumerado? type Exemplo1 = type 0..2; const ex1 = Exemplo1 (0); ex2 = Exemplo1 (1); ex3 = Exemplo1 (2); type Exemplo1 = type ex1..5; const ex4 = Exemplo1 (3); ex5 = Exemplo1 (4); ex6 = Exemplo1 (5); type Exemplo1 = type ex1..8; const ex40 = Exemplo1 (6); ex50 = Exemplo1 (7); ex60 = Exemplo1 (8);
GOSTEI 0
Motta
18/12/2003
Exemplo :
TFont.Style
Determines whether the font is normal, italic, underlined, bold, and so on.
type
TFontStyle = (fsBold, fsItalic, fsUnderline, fsStrikeOut);
TFontStyles = set of TFontStyle;
em runtime
procedure TForm1.Button1Click(Sender: TObject);
begin
Edit1.Font.Style := [fsBold, fsItalic, fsUnderline];
Edit1.Text := ´fsBold, fsItalic, fsUnderline´;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
Edit1.Font.Style := [];
Edit1.Text := ´fsBold, fsItalic, fsUnderline´;
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
Edit1.Font.Style := Edit1.Font.Style + [fsStrikeout];
end;
era isto ?
TFont.Style
Determines whether the font is normal, italic, underlined, bold, and so on.
type
TFontStyle = (fsBold, fsItalic, fsUnderline, fsStrikeOut);
TFontStyles = set of TFontStyle;
em runtime
procedure TForm1.Button1Click(Sender: TObject);
begin
Edit1.Font.Style := [fsBold, fsItalic, fsUnderline];
Edit1.Text := ´fsBold, fsItalic, fsUnderline´;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
Edit1.Font.Style := [];
Edit1.Text := ´fsBold, fsItalic, fsUnderline´;
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
Edit1.Font.Style := Edit1.Font.Style + [fsStrikeout];
end;
era isto ?
GOSTEI 0