Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2003.08.07;
Скачать: CL | DM;

Вниз

Мастера, помогите, почему у меня в цикле не   Найти похожие ветки 

 
Yuraz ©   (2003-07-25 10:24) [0]

Дело такое, есть текст, преобр. в переменную, в этой переменной ищу слово"<period>", нахожу, отрезаю начало переменной от конца слова "<period>", далее ищу это слово вновь, и т.д, запоминаю координаты вхождения. Идея вроде правильная, да вот реализовываю не правильно, всё время находит первое вхождение, и переменную не режет. :(


 
Yuraz ©   (2003-07-25 10:25) [1]

Да, код забыл привести, как делаю:

st:=Memo1.Text;

while Pos("<period>",st)>0 do
begin
a:=Pos("<period>",st);
showmessage(IntToStr(a));
Delete(st,0,a+8);
end;


 
Lord Warlock ©   (2003-07-25 10:32) [2]

a:=Pos("<period>",st);
while а>0 do
begin
a:=Pos("<period>",st);
showmessage(IntToStr(a));
Delete(st,0,a+8);
end;


 
Leshiy ©   (2003-07-25 10:32) [3]

...
Delete(st, 1,a+8);
...


 
Lord Warlock ©   (2003-07-25 10:32) [4]

a:=Pos("<period>",st);
while а>0 do
begin
showmessage(IntToStr(a));
Delete(st,0,a+8);
a:=Pos("<period>",st);
end;


 
Yuraz ©   (2003-07-25 10:38) [5]

Спасибо за помощь!


 
Leshiy ©   (2003-07-25 11:00) [6]

из хелпа
Delete removes a substring of Count characters from string S starting with S[Index]. S is a string-type variable. Index and Count are integer-type expressions.

If index is larger than the length of the S or less than 1, no characters are deleted.

If count specifies more characters than remain starting at the index, Delete removes the rest of the string. If count is less than 0, no characters are deleted.



Страницы: 1 вся ветка

Текущий архив: 2003.08.07;
Скачать: CL | DM;

Наверх




Память: 0.48 MB
Время: 0.016 c
3-20386
boka
2003-07-15 08:05
2003.08.07
Таблицы с расширением DAT


3-20391
WDenis
2003-07-16 09:14
2003.08.07
Передача параметров в отчет FastReport


1-20623
VD602
2003-07-24 22:50
2003.08.07
FileStream.WriteBiffer(SomeString, Length(SomeString));


3-20454
Nikolai_S
2003-07-17 15:40
2003.08.07
Проблема с Lookup полями в ADO с MS SQL Server


14-20719
Карелин Артем
2003-07-23 15:47
2003.08.07
Посоветуйте систему контроля версий.