PLEASE fix find&replace

Something you want to see in a LiveCode product? Want a new forum set up for a specific topic? Talk about it here.

Moderator: Klaus

Post Reply
croivo
Posts: 111
Joined: Wed Feb 26, 2014 11:02 pm

PLEASE fix find&replace

Post by croivo » Fri Apr 04, 2014 7:14 pm

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!!

andrewferguson
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 184
Joined: Wed Apr 10, 2013 5:09 pm

Re: PLEASE fix find&replace

Post by andrewferguson » Fri Apr 04, 2014 8:07 pm

Hello,
It seems like you have found a nasty bug.
All bug reports should be reported to http://quality.runrev.com/.
Andrew

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: PLEASE fix find&replace

Post by Simon » Fri Apr 04, 2014 8:24 pm

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
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

croivo
Posts: 111
Joined: Wed Feb 26, 2014 11:02 pm

Re: PLEASE fix find&replace

Post by croivo » Fri Apr 04, 2014 8:28 pm

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...

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: PLEASE fix find&replace

Post by Klaus » Sat Apr 05, 2014 2:12 pm

HI croivo,

just do it yourself :D

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 8)


Best

Klaus

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10305
Joined: Wed May 06, 2009 2:28 pm

Re: PLEASE fix find&replace

Post by dunbarx » Sat Apr 05, 2014 2:48 pm

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

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: PLEASE fix find&replace

Post by Klaus » Sat Apr 05, 2014 2:56 pm

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? :D

Post Reply