Hallo,
kann bitte jemand helfen:
Code in C:
Delphi-Quellcode:
unsigned int GetIndexToNextCharAfterSubString(const char* Buffer, const char* SubString, const unsigned int MaxLen)
{
for (unsigned int I=0;I<(MaxLen-(unsigned int)(strlen(SubString)-1));I++)
{
if (strlen(&Buffer[I])>=strlen(SubString)
&& Buffer[I]==SubString[0]
&& strncmp(&Buffer[I],SubString,strlen(SubString))==0)
{
return I+strlen(SubString);
}
}
Hier steht weiterer Code
}
Meine vermutete Übersetzung:
Delphi-Quellcode:
function GetIndexToNextCharAfterSubString(Buffer: PChar;
SubString: PChar; MaxLen: integer): integer;
var i: integer;
begin
for I:=0 to (MaxLen-length(SubString)-1) do
begin
if ((length(@Buffer[I])>=length(SubString) and
(Buffer[I]=SubString[0]) and (StrLComp(@Buffer[I],SubString,length(SubString))=0)) then
begin
result:= I+length(SubString);
end;
end;
Hier steht weiterer Code
end;
Die Fehlermeldung beim Compilieren in Delphi:
if ((length(@Buffer[I])>=... : Inkompatible Typen, 'String' und 'Pointer'.
Wer weiß Rat??
Danke.