Einzelnen Beitrag anzeigen

sdean

Registriert seit: 5. Dez 2009
64 Beiträge
 
#2

AW: Conversion from Cpp to Delphi

  Alt 27. Dez 2011, 15:59
for the 1st function is did this :

Delphi-Quellcode:
function StrSearch(mem: pbyte;text: pchar; size: DWORD):Boolean;
    var
    pchL: pbyte;
    offset: DWORD;
    length: DWORD;
    iMax: integer;
    begin
      pchL:=mem;
      offset:=DWORD(pchL);
      length:=offset+size;
      iMax:=lstrlen(text);
      while(offset<length) do
      begin
              if StrLIComp(PChar(pchL),PChar(text),iMax)=0 then
              begin
                 result:= true;
                 Break;
               end;
               inc(offset);
              inc(pchL);
            end;
           result:= false;
    end;
is that correct ?
  Mit Zitat antworten Zitat