Quote Originally Posted by Andreaz
PosEx is defined as
Code:
function PosEx(const SubStr, S: string; Offset: Cardinal = 1): Integer;
var
  I,X: Integer;
  Len, LenSubStr: Integer;
begin
  if Offset = 1 then
    Result := Pos(SubStr, S)
  else
  begin
    I := Offset;
    LenSubStr := Length(SubStr);
    Len := Length(S) - LenSubStr + 1;
    while I <= Len do
    begin
      if S&#91;I&#93; = SubStr&#91;1&#93; then
      begin
        X &#58;= 1;
        while &#40;X < LenSubStr&#41; and &#40;S&#91;I + X&#93; = SubStr&#91;X + 1&#93;&#41; do
          Inc&#40;X&#41;;
        if &#40;X = LenSubStr&#41; then
        begin
          Result &#58;= I;
          exit;
        end;
      end;
      Inc&#40;I&#41;;
    end;
    Result &#58;= 0;
  end;
end;
in delphi 7, it search for a string in a string with a start offset.
Excellent..

I couldn't find the source for that anywhere, I'll include it in my dclUser package . thanks andreaz