Вверх ↑
Ответов: 9906
Рейтинг: 351
#1: 2008-03-22 03:07:22 ЛС | профиль | цитата
Мне кажется, надо отрабатывать "пустые" случаи в GetTok

Может быть так...

type TIconsIdx = array of integer;

procedure ParseIconsIdx(var s:string; IconsIdx:TIconsIdx);
const _dlm = ',';
var sint, parse:string;
i:integer;
begin
for i:=0 to high(IconsIdx) do IconsIdx[i] := I_SKIP;
if (s = '') or (s[1] <> '<') or (Pos('>',s)=0) then exit;
Delete(s,1,1);
parse := GetTok(s,'>') + _dlm;
Replace(parse, ' ' ,'');
i:=0; repeat
sint := gettok(parse, _dlm);
if sint <> '' then IconsIdx[i] := str2int(sint);
inc(i);
until parse = '';
end;


карма: 9

0