![]() |
copy spinnt?
Hi,
ich hab nen großes Problem, ich glaube copy spinnt^^ Hier mal mein Code:
Code:
Das Problem ist diese Zeile "temp := copy(Serial, lStrich+1, i-1)"
function istSerial(Serial: String): Boolean;
var i, temp2, zaehlerStelle, zaehlerRichtige, lStrich: Integer; temp: String; begin zaehlerStelle := 0; zaehlerRichtige := 0; lStrich := 0; For i := 1 to 13 do begin if Serial[i] = '-' then begin temp := ''; temp := copy(Serial, lStrich+1, i-1); lStrich := i; zaehlerStelle := ZaehlerStelle + 1; case zaehlerStelle of 1: if IstGanzeZahl(StrToInt(temp)/8) then zaehlerRichtige := zaehlerRichtige + 1; 2: if IstGanzeZahl(StrToInt(temp)/9) then zaehlerRichtige := zaehlerRichtige + 1; 3: if IstGanzeZahl(StrToInt(temp)/25) then zaehlerRichtige := zaehlerRichtige + 1; 4: if IstGanzeZahl(StrToInt(temp)/82) then zaehlerRichtige := zaehlerRichtige + 1; 5: if IstGanzeZahl(StrToInt(temp)/23) then zaehlerRichtige := zaehlerRichtige + 1; 6: if IstGanzeZahl(StrToInt(temp)/1) then zaehlerRichtige := zaehlerRichtige + 1; 7: if IstGanzeZahl(StrToInt(temp)/8) then zaehlerRichtige := zaehlerRichtige + 1; 8: if IstGanzeZahl(StrToInt(temp)/8) then zaehlerRichtige := zaehlerRichtige + 1; 9: if IstGanzeZahl(StrToInt(temp)/7) then zaehlerRichtige := zaehlerRichtige + 1; 10: if IstGanzeZahl(StrToInt(temp)/6) then zaehlerRichtige := zaehlerRichtige + 1; 11: if IstGanzeZahl(StrToInt(temp)/3) then zaehlerRichtige := zaehlerRichtige + 1; 12: if IstGanzeZahl(StrToInt(temp)/7) then zaehlerRichtige := zaehlerRichtige + 1; 13: if IstGanzeZahl(StrToInt(temp)/8) then zaehlerRichtige := zaehlerRichtige + 1; end; end; end; if zaehlerRichtige = 13 then result := true else result := false; end; Wenn i = 5 ist und lStrich = 3 dann soll er nur das 4. Zeichen kopiere, kopiert aber vom 4 oder auch drittem bis zum 6 (i+1) woran kann das liegen? :gruebel: ich habe schon alles versucht, zweite variable, sogar ne Funktion alla :
Code:
Bitte helft mir ich komme nicht weiter..
function minuseins(var k: Integer):integer;
Gruß Tarry PS: Die Funktion soll testen ob der eingegeben String ne, von mir erstellte Serial ist... Beispiel Serial (Die Zahlen hab ich geändert, dadurch geht's nur um die Syntax): "2-65-3-18-69-51-42-11-36-117-36-72-25" |
Re: copy spinnt?
Guck dir mal die Hilfe zu
![]() |
Re: copy spinnt?
Zitat:
Guck Dir noch mal die Hilfe zu POS an! Der dritte Parameter gibt nicht an, bis zu welchem Zeichen kopiert werden soll, sonder wie viele Zeichen kopiert werden sollen. |
Re: copy spinnt?
Zitat:
Zitat:
|
Re: copy spinnt?
Ich habe geschrieben, du sollst dir die Bedeutung des "letzten Parameters" amgucken!
|
Re: copy spinnt?
Zitat:
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 13:54 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz