It is currently Tue Sep 17, 2019 8:14 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 61 posts ]  Go to page 1, 2, 3, 4, 5  Next
Author Message
 Post subject: [Done] [5.42] Replace by using old replace phrase fails...
PostPosted: Sat Mar 12, 2016 6:02 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Feb 09, 2006 11:27 pm
Posts: 2437
I have had to move some global vars into a procedure and so I wanted to change the keyword 'global' to 'protected'...
Code:
Global ggg
Global hhh
Global iii

Procedure a()

   Global aaa
   Global bbb
   Global ccc
   Global ddd
   Global eee
   Global fff

EndProcedure


I did the following steps:
* Double click on 'Global' in line 'Global aaa'
* Ctrl+F
* Replace with, set to 'Protected'
* 'Replace All' (still missing a shortcut for doing that)
* Oops, all global have been changed, so doing multiple Ctrl+Z do get all back to start
* Again, the cursor on 'Global' in the line 'Global aaa'
* Again Ctrl+F
* Now press 'Tab', 'Space', 'Tab' and 'Cursor Down' to see the 'Protected' text as the replace string
* Press the button 'Replace', no problem
* Press the button 'Replace' (one or more times), the replace string has been cleared and the text in the IDE will be deleted as well


Here's the result after doing the steps above:
Code:
Global ggg
Global hhh
Global iii

Procedure a()

   Protected aaa
    bbb
    ccc
   Global ddd
   Global eee
   Global fff

EndProcedure


Top
 Profile  
Reply with quote  
 Post subject: Re: [5.42] Replace by using old replace phrase fails...
PostPosted: Sun Mar 13, 2016 12:43 am 
Offline
Addict
Addict
User avatar

Joined: Mon Jul 25, 2005 3:51 pm
Posts: 3573
Location: Utah, USA
I can confirm. I can also report that both the search string and replacement string are affected the same way. All that is required is that the string be selected from the combobox and that 'Replace' is clicked twice. The effect happens on the second click.

The steps I used are:
* Move to first line (it works on any line and any source, but use Michaels source to make it easy)
* Ctrl+F (using the menu option works as well)
* Check the 'Replace with' checkbox using either the keyboard or mouse
* Select one or both the search string or the replacement string from their respective combobox
* Type in either the search or replacement string if it was not selected from a combobox so that neither is blank
* Press either the button 'Replace' or the button 'Replace All', no problem. The normal results occur, either to highlight the search string, replace the search string if already highlighted or to report no search strings found.
* Press either the button 'Replace' or the button 'Replace All' again, whichever strings were selected from a combobox drop-down list are cleared in the dialog box and no other action will be performed
* Any further Find/Replace operations will use the strings that were blanked instead of the original settings.

_________________
Image


Top
 Profile  
Reply with quote  
 Post subject: Re: [5.42] Replace by using old replace phrase fails...
PostPosted: Thu Mar 17, 2016 7:00 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Thu Jan 22, 2009 3:48 am
Posts: 596
Location: china
yes,this is a bug.

_________________
my pb for chinese:
http://ataorj.ys168.com


Top
 Profile  
Reply with quote  
 Post subject: Re: [5.42] Replace by using old replace phrase fails...
PostPosted: Wed Mar 30, 2016 7:30 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 07, 2007 3:25 pm
Posts: 3654
Location: Berlin, Germany
This bug is extremely annoying, and makes search and replace in the IDE useless not to say dangerous :!:

_________________
Please excuse my flawed English. My native language is PureBasic.
Search
RSBasic's backups


Top
 Profile  
Reply with quote  
 Post subject: Re: [5.42] Replace by using old replace phrase fails...
PostPosted: Wed Mar 30, 2016 7:43 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Dec 23, 2009 10:14 pm
Posts: 3055
Location: Boston, MA
For complicated(though this is not) search and replace I am forced to use NotePad++.

_________________
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum


Top
 Profile  
Reply with quote  
 Post subject: Re: [5.42] Replace by using old replace phrase fails...
PostPosted: Thu Mar 31, 2016 11:36 pm 
Offline
Enthusiast
Enthusiast

Joined: Mon Feb 04, 2013 5:28 pm
Posts: 332
Just found this, wiped off some code before I noticed what was happening.
Unfortunately you can't always use replace all, so you need to pay attention and restore the replacing string every time this has been erased.


Top
 Profile  
Reply with quote  
 Post subject: Re: [5.42] Replace by using old replace phrase fails...
PostPosted: Fri Apr 01, 2016 8:24 am 
Offline
Addict
Addict

Joined: Mon Feb 16, 2015 2:49 pm
Posts: 1896
You can always select a block of text first, and restrict the replace to that block.


Top
 Profile  
Reply with quote  
 Post subject: Re: [5.42] Replace by using old replace phrase fails...
PostPosted: Fri Apr 01, 2016 1:23 pm 
Offline
Enthusiast
Enthusiast

Joined: Mon Feb 04, 2013 5:28 pm
Posts: 332
Thanks for the suggestion, but I often need to do one yes, one no, three yes, one no, etc. so a block is not a comfortable solution.
The only good solution is to have the bug fixed, so I'll wait suffering a little in the meantime :)
After all I imagine is really a simple bug to fix.


Top
 Profile  
Reply with quote  
 Post subject: Re: [5.42] Replace by using old replace phrase fails...
PostPosted: Mon May 30, 2016 12:20 am 
Offline
Enthusiast
Enthusiast

Joined: Mon Feb 04, 2013 5:28 pm
Posts: 332
In my case the temporary (?) "fix" is to edit the field with the word you just selected from the combobox, for example adding a space at the end and then removing it.
After that I hit replace and the field is not blanked out anymore on the subsequent replace.


Top
 Profile  
Reply with quote  
 Post subject: Re: [5.42] Replace by using old replace phrase fails...
PostPosted: Sat Jul 09, 2016 2:08 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Thu Jan 22, 2009 3:48 am
Posts: 596
Location: china
have this bug from v5.42,
so i always use v5.41 hitherto

_________________
my pb for chinese:
http://ataorj.ys168.com


Top
 Profile  
Reply with quote  
 Post subject: Re: [5.42] Replace by using old replace phrase fails...
PostPosted: Sat Jul 23, 2016 9:03 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Thu Jan 22, 2009 3:48 am
Posts: 596
Location: china
I guess bug cause,likeness code2:

;code1:
Code:
Global test=8
Procedure test()
Debug test;=8
EndProcedure
test()


;code2:
Code:
Procedure test()
Debug test;=0
EndProcedure
Global test=8
test()

=============
chm-Reference/global.html:
In this case the command Global must be called for the according variables, before the declaration of the procedure.

_________________
my pb for chinese:
http://ataorj.ys168.com


Top
 Profile  
Reply with quote  
 Post subject: Re: [5.42] Replace by using old replace phrase fails...
PostPosted: Sat Jul 23, 2016 10:53 am 
Offline
Enthusiast
Enthusiast

Joined: Mon Feb 04, 2013 5:28 pm
Posts: 332
I fail to see what the above has to do with the search/replace bug reported in this thread.

But it's bumping the thread so it has some (shameful) redeeming qualities, after all we are at beta 3 and the seed of doubt is growing :lol:


Top
 Profile  
Reply with quote  
 Post subject: Re: [5.42] Replace by using old replace phrase fails...
PostPosted: Sun Jul 24, 2016 6:16 am 
Offline
PureBasic Expert
PureBasic Expert

Joined: Sun Apr 12, 2009 6:27 am
Posts: 3395
Using Ctrl-F
The IDE Search & Replace Search inside Selection only disabled
It will be enabled after selction

It works as expected
1 - Select what is inside the procedure
2- In search and replace dialog select Search inside Selection only
3- Replace All

_________________
Egypt my love


Top
 Profile  
Reply with quote  
 Post subject: Re: [5.42] Replace by using old replace phrase fails...
PostPosted: Sun Jul 24, 2016 7:18 am 
Offline
Addict
Addict
User avatar

Joined: Sat Feb 19, 2011 3:47 am
Posts: 2213
Location: Singapore
Yes; the issue persists in the latest version. However, it should be noted that it only occurs when the replace string is selected from the Replace with: drop list. Typing in the replace string manually circumvents the issue. :wink:

_________________
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too!


Top
 Profile  
Reply with quote  
 Post subject: Re: [5.42] Replace by using old replace phrase fails...
PostPosted: Sun Jul 24, 2016 8:08 am 
Offline
Addict
Addict
User avatar

Joined: Mon Jul 25, 2005 3:51 pm
Posts: 3573
Location: Utah, USA
TI-994A wrote:
Yes; the issue persists in the latest version. However, it should be noted that it only occurs when the replace string is selected from the Replace with: drop list. Typing in the replace string manually circumvents the issue. :wink:

It also occurs when something is selected from the Search For: drop list. In either or both cases whichever item(s) were selected from the drop lists are replaced with and empty string after the first Replace or Replace All operation.

_________________
Image


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 61 posts ]  Go to page 1, 2, 3, 4, 5  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye