hallo erstmal!
ich bastel gerade wieder ein wenig und stecke wieder mal fest.
ich wollte mir eine funktion oder procedure erstellen um mir etwas code zu sparen. ich müsste sonst sehr oft folgendes tippen:
Delphi-Quelltext
1:
| if(panel3.caption='X')and(panel4.caption='X')and(panel5.caption='X') then result:='1'; |
nun dachte ich, ich mache es so:
Delphi-Quelltext
1: 2: 3: 4:
| function check_win():string; begin if (panel3.caption='X')and(panel4.caption='X')and(panel5.caption='X') then result:='1'; end; |
ging nicht also dachte ich:
Delphi-Quelltext
1: 2: 3: 4:
| procedure check_win(); begin if (panel3.caption='X')and(panel4.caption='X')and(panel5.caption='X') then result:='1'; end; |
aber auch das geht nicht, weil dann immer panel3 nicht anerkannt wird. wieso? wie mache ich es sonst?
später aufrufen wollte ich es dann einfach nur mit:
Delphi-Quelltext
1:
| if check_win='1' then... |
sicherlich falsch aber wie sonst?
vielen dank im vorraus!