Welcome! Log In Create A New Profile

Advanced

[WD18] Problem with find and replace using double quotes

Posted by Al 
Hello All

The find and replace in WD18 has had many improvements but from my perpective appears to have one bad improvement.

In V16 a search for "DIR" would find exactly that - the letters DIR only where they were enclosed in double quotes.

In V18 the same search returns every occurance of DIR with and without the quotes and when it highlights the found items, it only colours the letters DIR not the quote marks so clearly it did not search for "DIR" but DIR

The only way to get it to find "DIR" is to use double quotes and search for ""DIR"".
This behaviour also affects the replace and before I realised that it required double double quotes, I managed to completely screw up some code where I did a replace of code that involved double quotes as it did not replace the quotes in the same way as it would have done in V16.

There was nothing in the V18 help to highlight the changed method.

Regards
Al
Hi Al

to complete your mesage, I found out yesterday that if you search for several words (in my case, it was "is int", but WITHOUT the quote), it will find all the LINES in which there are both "is" and "int" even if they are not together, but NOT the line where there is ONLY "is" or ONLY "int"...

This behavior explains the bad experience I had with a SEARCH AND REPLACE where I wanted to replace all the "is int" by "is int on 8"....

If you have time and want to have fun, try it WITHOUT the quote... the result looks like the love child of a stutterer and a mad scientist... But make a backup before you do, please :-)

Now, I must say that there IS a (very small) "?" icon at the end of the search field that gives SOME indications... but clearly not enough as F1 doesn't seem to link to any specific help page.

But clearly, the search is much more powerfull, especially with the possibility to exclude words too...

Now it seems that the unit in which the search is done is the LINE of code... I haven't yet been able to determine if it is the physical or the logical line of code that is used (ie if multiline instructions (...) and multiline strings ([ ]) are seen/searched as one line or several...

Maybe someone else has made some other discoveries and would like to share them here?

Best regards
Hello Fabrice.

It is a pity because the search and replace in V16 - although it could crash the IDE during a search - was completely reliable in terms of its functionality.

At the moment I find myself doing 2-3 searches on different parameters and I am too nervous to do a replace, I am doing them by hand. Thank goodness I am only doing a small project in V18.

Search and replace is a very basic developer tool and something we must have absolute confidence in. I would be just as happy to drop back to the functionality of V16 and do without the new options if they are not reliable.

Regards
Al.
Hello All

The problem with searching for an item with double quotes has just bitten me again. I forgot about having to use double double quotes and did a search for "G" and about 3 minutes later the search system informed me that it had found 22,685 occurances of G, in fact there are only 3 instances of "G".
On the plus side the search is more robust than previous versions, as it didn't crash during this self imposed large search.

Regards
Al
Arnaud Benhamdine
Re: [WD18] Problem with find and replace using double quotes
July 22, 2013 07:35AM
Hello all,

I ran into a similar problem very recently : I tried to search for two consecutives double quotes (so : "") to make a search and replace, and, suprisingly, the search found nothing (although I had 2 ou 3 cases in y code).

I submitted the bug to PCS on June, 26th, and they gave me n°83 025.

Regards, Arnaud.
double quote is Caract(34) , so search for Caract(34)


//replace double quote " with -
//-----------------------------------------------------------
PROCEDURE replace_str(str_tmp is UNICODE string)
str_tmp = Replace(str_tmp,Caract(34),"-")
RESULT str_tmp
//-----------------------------------------------------------
Arnaud Benhamdine
Re: [WD18] Problem with find and replace using double quotes
July 27, 2013 10:40PM
Quote
roseman1986
double quote is Caract(34) , so search for Caract(34)


//replace double quote " with -
//-----------------------------------------------------------
PROCEDURE replace_str(str_tmp is UNICODE string)
str_tmp = Replace(str_tmp,Caract(34),"-")
RESULT str_tmp
//-----------------------------------------------------------

Roseman, the previous posts were related to the search panel in Windev IDE, not the function Replace(). So the code you proposed can NOT be usable, because it would be applied on windev code.
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: