Autor Beitrag
mimi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3458

Ubuntu, Win XP
Lazarus
BeitragVerfasst: Sa 29.03.03 21:14 
Hallo,
wenn ich bei folgender funktion:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
function GetLevelIndexStr(FileNameS:String):Integer;
var
  i:Integer;
begin
//  result:=-1;
  for i:=1 to MissionsLevelInhalt.Count -1 do begin
    if GetToken( MissionsLevelInhalt.Strings[i],':',1) = FileNameS then begin
      Result:=i;
      Break;
    end;
  end;
end;

das kometar weg mache so das Result auf -1 gesetzt wird, kommt der [Fantle Fehler] BC2241 warum kann mir das jammden erklären ???

_________________
MFG
Michael Springwald, "kann kein englisch...."
Aya
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1964
Erhaltene Danke: 15

MacOSX 10.6.7
Xcode / C++
BeitragVerfasst: Sa 29.03.03 21:30 
Hi,

ich nehme mal an, weil dort wo du die funktion aufrufst ein Rückgabewert von -1 einen Fehler auslöst... ;)

Zeig doch mal die stelle wo du die Funktion aufrufst :)

Au'revoir,
Aya~

_________________
Aya
I aim for my endless dreams and I know they will come true!
mimi Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3458

Ubuntu, Win XP
Lazarus
BeitragVerfasst: Sa 29.03.03 21:44 
ne wenn ich result reinmache geht es, wenn ich result rausmache kommt diese fehler.

und das komische ist daran: das progrann fuktioniert einwandfrei.....
sollte ich mal bei borland nachfragen ????

_________________
MFG
Michael Springwald, "kann kein englisch...."
Aya
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1964
Erhaltene Danke: 15

MacOSX 10.6.7
Xcode / C++
BeitragVerfasst: Sa 29.03.03 21:46 
äh...

kommt der fehler jetzt wenn du die Resultzeile drin hast, oder wenn du sie auskommentiert hast?

Au'revoir,
Aya

_________________
Aya
I aim for my endless dreams and I know they will come true!
mimi Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3458

Ubuntu, Win XP
Lazarus
BeitragVerfasst: Sa 29.03.03 22:12 
wenn ich die result zeile rausnehme kommt diese Fehlermeldung....
Eigentlich dürfe nur eine wahrung kommen(nicht wahr ?)

_________________
MFG
Michael Springwald, "kann kein englisch...."
mimi Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3458

Ubuntu, Win XP
Lazarus
BeitragVerfasst: Sa 29.03.03 22:13 
mir ist aufgefallen das ich es in der falschen sparte geschrieben habe :(
könntes du es verschieben ??
und zwar nach sonstiges ???

_________________
MFG
Michael Springwald, "kann kein englisch...."
Aya
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1964
Erhaltene Danke: 15

MacOSX 10.6.7
Xcode / C++
BeitragVerfasst: Sa 29.03.03 22:15 
Hi,

na ja... wenn du sie rausmachst wird Result niemals initialisiert, kann somit auch von anfang an einen wert von 548756467 oder so haben *g+ Jenachdem was da grad im Speicher steht ;)

und das wird wahrscheinlich dann der fehler sein...
lass dir Result dochmal anzeigen:

ausblenden Quelltext
1:
 ShowMessage(IntToStr(GetLevelIndexStr(FileName))):					


Au'revoir,
Aya

_________________
Aya
I aim for my endless dreams and I know they will come true!
mimi Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3458

Ubuntu, Win XP
Lazarus
BeitragVerfasst: Sa 29.03.03 22:58 
aber dann sollte er doch nur eine wahrung anzeigen oder ?
Zitat:

[Warnung] Unit1.pas(835): Rückgabewert der Funktion 'GetLevelIndexStr' könnte undefiniert sein
[Fataler Fehler] Interner Fehler: BC2241

das kommt wenn ich es kompielre....

_________________
MFG
Michael Springwald, "kann kein englisch...."