function ParseOwnerAndAudioIDPair(const S: string; out AOwnerID, ID: Integer; out AccessKey: String): Boolean;
var
AParts: TStringDynArray;
begin
AParts := SplitString(S, '_');
Result := Length(AParts) >= 2;
if Result then
begin
AOwnerID := StrToIntDef(AParts[0], 0);
ID := StrToIntDef(AParts[1], 0);
if Length(AParts) >= 3 then
AccessKey := AParts[2];
Result := (AOwnerID <> 0) and (ID <> 0);
end;
end;
Вот корректная версия:
uses System.StrUtils, System.Types;
function ParseOwnerAndAudioIDPair(const S: string; out AOwnerID, ID: Integer; out AccessKey: String): Boolean; var AParts: TStringDynArray; begin AParts := SplitString(S, '_'); Result := Length(AParts) >= 2; if Result then begin AOwnerID := StrToIntDef(AParts[0], 0); ID := StrToIntDef(AParts[1], 0); if Length(AParts) >= 3 then AccessKey := AParts[2]; Result := (AOwnerID <> 0) and (ID <> 0); end; end;