Re: problems with 4.0.3
- Posted by DerekParnell (admin) Oct 08, 2011
- 1167 views
... when tracing a program using v4.0.3, i cannot F1/F2 to see the output
This is a bug that occurs when Euphoria is built using MingW (GCC for Windows). I'm current working on a fix for this and it will probably be released very shortly. If you build Euphoria using Watcom, then this bug does not occur.
Problem two is remove_all() doesn't, on v40b4-3412 or on v4.0.3.
The purpose of remove_all is to remove all elements in the second parameter that equal the first parameter. To quote the manual ...
This function weeds elements out, not sub-sequences.
In the example you gave there is no single element in the second parameter that is equal to "?selectlang=ru.' Remember that a string is a sequence of integer elements (characters), so you can see that there is no character that matches the string "?selectlang=ru".
I'm a bit surprised that we don't have a function that does what you want but here is an example function that you can use for now.
include std/console.e public function remove_match(object needle, sequence haystack) integer found = 1 while found with entry do haystack = remove( haystack, found, found + length(needle) - 1 ) entry found = match( needle, haystack, found ) end while return haystack end function sequence data data = "<a href=\"?selectlang=ru\"><img>" display(data) data = remove_match("?selectlang=ru", data) display(data)