これでどーよ

function Like(Str,Ptn:string):Boolean;
var
 P,I:Integer;
begin
 Result := False;
 if Str = '' then Exit;
 if Ptn = '' then Exit;
 P := 1;
 I := 1;
 while (P <= Length(Ptn)) and ( Ptn[P] = '*' ) do Inc(P);
 while (I <= Length(Str)) and ( P <= Length(Ptn) )do begin
  if Ptn[P] = '?' then
   Inc(P)
  else begin
   if Ptn[P] = '*' then Inc(P);
   if Ptn[P] = Str[I] then Inc(P);
  end;
 Inc(I);
 end;

 Result := (P > Length(Ptn)) and (I > Length(Str) );
 { Ptn が含まれているかどうかを調べるには以下の結果を使う }
 { Result := P > Length(Ptn); }
end;