#155509 - 2006-01-17 06:00 PM
Replace() - A function to quickly replace stuff in stuff
|
Lonkero
KiX Master Guru
   
Registered: 2001-06-05
Posts: 22346
Loc: OK
|
what bigger the data one uses, that slower the good old join(split($stuff,$stuffToReplace),$stuffThatReplaces) becomes.
I was just playing with wkix32.exe and coded a UDF that made it a var inside a script. after some 30 mins, had to stop the process. it just took way too much time.
now, if we had Replace() the processor intensive work could be done inside the kix itself and speed gains would be great with just some 10.000 element arrays.
so, I suggest that you ruud dear add the following: Replace(WHERE,WHAT,WITH)
the parameters could be: WHERE - string or array. if string, works just like join split. if array, works like ascan() -> replace WHAT - what to replace. if string, replaces this with WITH. if array, replaces each element with corresponding element of WITH WITH - replace with this. if string, replaces all matches by WHAT with this. if array, WHAT must be an array and per element match and replace occurs.
_________________________
!download KiXnet
|
Top
|
|
|
|
#155513 - 2006-01-19 10:07 AM
Re: Replace() - A function to quickly replace stuff in stuff
|
Richard H.
Administrator
   
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
Quote:
Nondeterministic Finite Automaton (NFA) ... hey, I think I married one of those.
Wow! I married a Finite State Machine (FSM) - are we related?
|
Top
|
|
|
|
Moderator: Lonkero, ShaneEP, Jochen, Radimus, Glenn Barnas, Allen, Ruud van Velsen, Mart
|
0 registered
and 579 anonymous users online.
|
|
|