Autor Beitrag
$veno
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 42



BeitragVerfasst: Do 22.09.05 19:10 
Hallo:)

Zu welcher Klasse gehören mathematische Zeichen wie + oder -?
AXMD
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: Do 22.09.05 19:11 
Klasse? Hm... Kategorie würde eher passen, aber egal... Operatoren.

AXMD
$veno Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 42



BeitragVerfasst: Do 22.09.05 19:14 
Danke:)

Muss ich dann wenn ich einen Operator als Parameter einer Funktion benutzen möchte das so eingeben:

function xyz (zeichen: operator);
AXMD
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: Do 22.09.05 19:16 
Einen Parameter kannst du nicht als Parameter einer Funktion verwenden ;)

AXMD
Alstar
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 827



BeitragVerfasst: Do 22.09.05 19:40 
user profile iconAXMD hat folgendes geschrieben:
Einen Parameter kannst du nicht als Parameter einer Funktion verwenden ;)

AXMD

Du meinst eher "Einen Operator kannst du nicht als Parameter einer Funktion verwenden"?!

Alstar
AXMD
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: Do 22.09.05 19:41 
Argx, ja :x

AXMD
Kroko
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1284

W98 W2k WXP
Turbo D
BeitragVerfasst: Fr 23.09.05 07:57 
oder so
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
type
  TOperator = (opAdd,opSub,opMul,opDiv);

const
  TOperatorChar: array[TOperator] of Char
               = (('+'),('-'),('*'),('/'));

function Compute (const Zahl1,Zahl2: Integer; const Operator: TOperator): Integer;
begin
  case Operator of
    opAdd: Result := Zahl1+Zahl2;
    opSub: Result := Zahl1-Zahl2;
    opMul: Result := Zahl1*Zahl2;
    opDiv: Result := Zahl1 div Zahl2;
    else Result := 0;
  end;
end;
$veno Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 42



BeitragVerfasst: Mi 19.10.05 19:51 
Ahh, danke, das ist ne gute Idee :)