Autor Beitrag
Greek
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 45



BeitragVerfasst: So 16.11.08 22:27 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
var wert : integer;
    Note : string;
begin
  wert:=StrToInt(Edit1.Text);
  Case wert of
  0..20 : Note:= 6;
  21..27 : Note:= 5-;
  28..34 : Note:= 5 ;
  35..40 : Note:= 5+;
  41..45 : Note:= 4-;
  46..50 : Note:= 4 ;
  51..55 : Note:= 4+;
  56..60 : Note:= 3-;
  61..65 : Note:= 3 ;
  66..70 : Note:= 3+;
  71..75 : Note:= 2-;
  76..80 : Note:= 2 ;
  81..85 : Note:= 2+;
  86..90 : Note:= 1-;
  91..95 : Note:= 1 ;
  96..100 : Note:= 1+;
  end;
  Memo1.Lines.Add(Note);


Wo ist der fehler?

inkompitable typen string und integer und ausdruck erwartet aber ; gefunden...
nagel
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 708

Win7, Ubuntu 10.10

BeitragVerfasst: So 16.11.08 22:32 
Note ist ein String, demnach Note := '6'; und entsprechend.
Greek Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 45



BeitragVerfasst: So 16.11.08 22:56 
argh xD, dachte auch erst ich müsste ' noch machen, aber habs dann doch gelassen^^

danke
nagel
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 708

Win7, Ubuntu 10.10

BeitragVerfasst: So 16.11.08 23:00 
Bitte. Der "Ausdruck erwartet..."-Fehler sollte sich damit auch gelöst haben, oder?
ub60
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 764
Erhaltene Danke: 127



BeitragVerfasst: So 16.11.08 23:05 
Nur mal so als generelle Bemerkung: Die Prozente können auch gebrochene Zahlen sein!
Du wirst um ein mehrfach verschachteltes if..then..else.. nicht herumkommen.

ub60
Martok
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 3661
Erhaltene Danke: 604

Win 8.1, Win 10 x64
Pascal: Lazarus Snapshot, Delphi 7,2007; PHP, JS: WebStorm
BeitragVerfasst: Mo 17.11.08 04:01 
Wenn er nur Integer abfragt, ist es egal ;)

_________________
"The phoenix's price isn't inevitable. It's not part of some deep balance built into the universe. It's just the parts of the game where you haven't figured out yet how to cheat."