Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "KOL";
Текущий архив: 2006.02.05;
Скачать: [xml.tar.bz2];

Вниз

stuffstring   Найти похожие ветки 

 
Lars   (2005-06-10 11:30) [0]

Is there anything like stuffstring in KOL? Replace or stuff strings into other strings by precise positioning?

I looked over my KOL 2.0 help files and couldn"t find anything close yet.


 
Thaddy   (2005-06-10 13:50) [1]

There are lots, just keep looking ;)

strrepeat for example is a stuffing one.

Also: most of the fastcode stuff works great with kol.


 
Lars   (2005-06-10 14:36) [2]

The strepeat just repeats the string... That"s pretty simple, isn"t it?

Here is the stuffstring function from freepascal:

Function StuffString(const AText: string; AStart, ALength: Cardinal;  const ASubText: string): string;

var i,j : longint;

begin
 j:=length(ASubText);
 i:=length(AText);
 SetLength(Result,i-ALength+j);
 move (AText[1],result[1],AStart-1);
 move (ASubText[1],result[AStart],j);
 move (AText[AStart+ALength], Result[AStart+j],i-AStart-ALength+1);
end;

Hmm have to see if I can use it, without calling on too much initialization/finalization.

I"ve used FastCode before but I think it was more StringReplace only? I"ll have to check deeper into it.


 
Thaddy   (2005-06-10 14:42) [3]

Look at the fastmove code ;)


 
Lars   (2005-06-10 18:05) [4]

Calling on stuffstring from strutils brings in 50KB ...


 
Lars   (2005-06-10 19:53) [5]

Ok cutting the functions out of system (MOVE) and strutils (stuffstring) makes the application now only gain about 5k or so.

I guess the initialization code is huge... in system or strutils. Or the smart linking just isn"t smart enough.

Now my problem is that the regex unit I am working with (modified MHregexpr) is crashing when I use a backslash behind a square bracket.

i.e. crashes with regex.expression:= "\[text\]";
but no crash with regex.expression:= "\tex\t";

Guess I"ll have to compile in delphi and compare findings.. either a regex bug or freepascal bug.


 
Thaddy   (2005-06-11 00:34) [6]

Ask the guy!
He"s pretty active on this forum. ;)


 
Lars   (2005-06-11 06:00) [7]

Where is he... What does he go by here ;)? Does he talk in english to us?? hehe

Well since stuffstring is useful, should I make a unit for KOL that uses freepascal"s stuffstring (later, maybe with fastcode).

I can"t beleive that it calls on 50K of code.. but when I cut and paste the functions into a unit of my own, it"s only 3-5 k or so./



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

Форум: "KOL";
Текущий архив: 2006.02.05;
Скачать: [xml.tar.bz2];

Наверх




Память: 0.45 MB
Время: 0.011 c
3-1133766049
Vale
2005-12-05 10:00
2006.02.05
Права доступа к MSSQL 2000


2-1137578044
tigra
2006-01-18 12:54
2006.02.05
StringGrid-страшная зверя


15-1137044415
begin...end
2006-01-12 08:40
2006.02.05
С Днём рождения! 12 января


15-1137196835
Джо
2006-01-14 03:00
2006.02.05
Отладка многопоточных приложений, C+A+D


11-1118243553
Владимир Кладов
2005-06-08 19:12
2006.02.05
Смешивание звуков





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский