function QuotedStr2(AStr: string): string;var iPos: Integer; TmpStr: string;begin iPos := Pos(',', AStr); if iPos = 0 then Result := AStr else begin while iPos > 0 do begin TmpStr := Copy(AStr, 1, iPos -1); Delete(AStr, 1, iPos); if Result <> '' then Result := Result + ','; Result := Result + QuotedStr(TmpStr); iPos := Pos(',', AStr); end; if AStr <> '' then Result := Result + ',' + QuotedStr(AStr); end;end;