Autor Beitrag
Tjeri
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 46



BeitragVerfasst: Fr 12.06.09 22:57 
Hallo, ich hab hier mal eine kleine Funktion gebastelt die auch funktioniert, nur hab ich da eine Fehlermeldung:
ausblenden Quelltext
1:
[Error] Unit1.pas(86): Missing operator or semicolon					


und zwar sieht das ganze so aus:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
function TFarbspiele.Farbe(farbe:integer):integer;
begin
  Case farbe of
     0: result:=0;
     1: result:=8421504;
     2: result:=10485760;
     3: result:=16711680;
     4: result:=16744448;
     5: result:=25600;
     6: result:=46080;
     7: result:=65280;
     8: result:=128;
     9: result:=255;
    10: result:=8421631;
    11: result:=65535;
    12: result:=33023;
    end;
end;


Und hier kommt die Fehlermeldung:
ausblenden Delphi-Quelltext
1:
2:
3:
  if Farbauswahl.ItemIndex>-1
    then farbe:=Farbe(Farbauswahl.ItemIndex)
    else farbe:=0;


Moderiert von user profile iconNarses: Code- durch Delphi-Tags ersetzt
Xentar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2077
Erhaltene Danke: 2

Win XP
Delphi 5 Ent., Delphi 2007 Prof
BeitragVerfasst: Fr 12.06.09 23:00 
Naja, du hast eine Funktion Farbe, aber anscheinend auch eine Variable "farbe", der du versucht, das Ergebnis der funktion zuzuweisen.
Nenn eins von beiden um, und gut ist.

_________________
PROGRAMMER: A device for converting coffee into software.
Tjeri Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 46



BeitragVerfasst: Fr 12.06.09 23:01 
ach wie bescheuert :oops:
Xentar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2077
Erhaltene Danke: 2

Win XP
Delphi 5 Ent., Delphi 2007 Prof
BeitragVerfasst: Fr 12.06.09 23:09 
Übrigens, für Farben solltest du wenn möglich die Farbcodes, also z.B. clBlack, oder wenigstens die RGB Darstellung wählen, also RGB(1,2,3); .
Macht die ganze Sache wesentlich übersichtlicher, als 12345678 ;)

_________________
PROGRAMMER: A device for converting coffee into software.
Tjeri Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 46



BeitragVerfasst: Fr 12.06.09 23:20 
ja vll aber rgb codes kann man da ja so nicht eingeben deswegen hab ich die genommen^^
man sieht es aber wenn man die Form hat oder ich schreib kommis dahinter^^
Xentar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2077
Erhaltene Danke: 2

Win XP
Delphi 5 Ent., Delphi 2007 Prof
BeitragVerfasst: Fr 12.06.09 23:24 
user profile iconTjeri hat folgendes geschrieben Zum zitierten Posting springen:
ja vll aber rgb codes kann man da ja so nicht eingeben deswegen hab ich die genommen^^

Äh, doch, dafür hab ich ja die RGB Funktion erwähnt.
ausblenden Delphi-Quelltext
1:
Farbe := RGB(255,0,0);  // Rot					

_________________
PROGRAMMER: A device for converting coffee into software.
Tjeri Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 46



BeitragVerfasst: Fr 12.06.09 23:40 
dummerweise weiß ich die rgb codes nicht mehr alle so genau aber ich gucks mir an
Tjeri Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 46



BeitragVerfasst: Fr 12.06.09 23:45 
noch ein kleines problem, meine eine radiogroup lässt sich nicht mehr blicken, wenn ich sie im code auf visible=true stell bleibt sie unsichtbar und die items fügt er auch nicht hinzu die ich ihm sag die er machen soll
Xentar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2077
Erhaltene Danke: 2

Win XP
Delphi 5 Ent., Delphi 2007 Prof
BeitragVerfasst: Fr 12.06.09 23:46 
Hat nix mehr mit "Fehler bei Aufruf einer Funktion" zu tun, also mach bitte ein neues Thema auf.

_________________
PROGRAMMER: A device for converting coffee into software.