Page 1 of 1
					
				PLEASE fix find&replace
				Posted: Fri Apr 04, 2014 7:14 pm
				by croivo
				When I want to find some code in my project in all tabs opened in script editor and replace it, LiveCode crashes... Problem is not in finding code - when I want to replace all, then it just keep 'replacing', but actually nothing happens (and I was waiting long time...).
I have about 100 buttons in my stack and i cant replace same code in all buttons at once. If i do this manually, this would take me about 10 hours...
Please fix this annoying bug! Thanks!!
			 
			
					
				Re: PLEASE fix find&replace
				Posted: Fri Apr 04, 2014 8:07 pm
				by andrewferguson
				Hello,
It seems like you have found a nasty bug.
All bug reports should be reported to 
http://quality.runrev.com/.
Andrew
 
			 
			
					
				Re: PLEASE fix find&replace
				Posted: Fri Apr 04, 2014 8:24 pm
				by Simon
				Hi croivo,
If you have a 100 buttons that have the same code in them you should be using a behavior.
Doesn't have to be the full code of the button it could just be part;
on mouseEnter
set cursor to "hand"
etc.
If that was in each of your buttons you could just have a single button who's behavior all the other buttons could copy.  That way you only have to change 1 button to change them all.
Make sense?
Simon
			 
			
					
				Re: PLEASE fix find&replace
				Posted: Fri Apr 04, 2014 8:28 pm
				by croivo
				Simon wrote:Hi croivo,
If you have a 100 buttons that have the same code in them you should be using a behavior.
Doesn't have to be the full code of the button it could just be part;
on mouseEnter
set cursor to "hand"
etc.
If that was in each of your buttons you could just have a single button who's behavior all the other buttons could copy.  That way you only have to change 1 button to change them all.
Make sense?
Simon
Code is not exactly the same... Very similar...
 
			 
			
					
				Re: PLEASE fix find&replace
				Posted: Sat Apr 05, 2014 2:12 pm
				by Klaus
				HI croivo,
just do it yourself 
 
Create a button with a script like this:
Code: Select all
on mouseup
  repeat with i = 1 to 100
    put the script of btn i into tScript
    replace "This string" with "That string" in tScript
    set the script of btn i to tScript
  end repeat
end mouseup
Won't take 10 hours 
 
Best
Klaus
 
			 
			
					
				Re: PLEASE fix find&replace
				Posted: Sat Apr 05, 2014 2:48 pm
				by dunbarx
				All this clever stuff begs the issue of why LC crashes under the load. If you can send a stack that reliably does this, the RR team would love to see it.
Craig Newman
			 
			
					
				Re: PLEASE fix find&replace
				Posted: Sat Apr 05, 2014 2:56 pm
				by Klaus
				dunbarx wrote:All this clever stuff begs the issue of why LC crashes under the load.
It does? Sorry, the script was out of my head, never tested it.
dunbarx wrote:If you can send a stack that reliably does this, the RR team would love to see it.
Does what? Work or crash reliably? 
