Autor Beitrag
bms
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 735

Win XP
Delphi 3, Delphi 6 PE, Delphi 2005 PE
BeitragVerfasst: Fr 31.12.04 16:41 
Ich hab ein Problem bei Übergabe eines Sets

ausblenden Delphi-Quelltext
1:
2:
const
  h = ['0'..'9', 'A'..'F'];


Nun will ich das als Parameter übergeben

ausblenden Delphi-Quelltext
1:
2:
3:
procedure (h: yxz);
begin
  if '3' in h then ...


Was muß ich als Parametertyp übergeben? Da komme ich nicht drauf.

_________________
VORSICHT: Ich behersche seit heute die Fünf-Finger-Handflächen-Herz-Explodier-Schlag-Kampf-Technik >:(
Benutzername
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 210

Win XP Pro
Delphi 7 PE, D2005 Prof. SSL
BeitragVerfasst: Fr 31.12.04 17:30 
Mach doch aus dem const ein type und schreib
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
procedure machwas(zeug:h);
begin
if 'd' in zeug then
...
end;
bms Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 735

Win XP
Delphi 3, Delphi 6 PE, Delphi 2005 PE
BeitragVerfasst: Fr 31.12.04 17:44 
Danke für den Tip, ist aber nicht die Antwort auf meine Frage. Irgendwie kriege ich das schon hin, aber ich hab es mir vorgenommen so zu machen ;)

_________________
VORSICHT: Ich behersche seit heute die Fünf-Finger-Handflächen-Herz-Explodier-Schlag-Kampf-Technik >:(
ScorpionKing
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1150

Win XP

BeitragVerfasst: Fr 31.12.04 18:37 
es wäre möglich folgendes zu machen:

ausblenden Quelltext
1:
2:
3:
4:
procedure Test(var x);
begin
...
end;


wenn man keinen typ angibt, kann man sozusagen jeden typ benutzen!
ich hoffe das (klappt und) hilft dir weiter!

MfG, Scorpion

_________________
Aus dem Urlaub zurück!
Benutzername
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 210

Win XP Pro
Delphi 7 PE, D2005 Prof. SSL
BeitragVerfasst: Fr 31.12.04 18:51 
Wenns nicht klappt, kanst du zur Not immer noch Variant als Typ angeben ;-)
Irgendwie hab ich zwar persönlich gegen Variants (fragt nicht wieso...) aber zur Not ;-)