Splitstr

09:38
type TNumarray = array of integer;
//Разбивает строку instr. Результат в outarr: TNumarray (array of integer)
function Splitstr(instr: string; var outarr: TNumarray): boolean; //[x]
var
len, j, strnum: integer;
begin
j := pos(';', instr);
len := 1;
result := false;
if j <> 0 then begin
while j <> 0 do begin
try
strnum := strtoint(copy(instr, 1, j - 1));
SetLength(outarr, len);
outarr[len - 1] := strnum;
inc(len);
except
end;
delete(instr, 1, j);
j := pos(';', instr);
end;
try
strnum := strtoint(instr);
SetLength(outarr, len);
outarr[len - 1] := strnum;
result := true;
except
end;
end;
end;