Re: replaceText problem

2015-01-12 Thread Peter Haworth
I found the problem. This was during the course of updating the RegEx Builder stack and there was code in there to put "(" before the regex if it didn't start with "(" and also to put ")" after the regex if it wasn't already there. In the above regex, that resulted in putting "(" before the regex

Re: replaceText problem

2015-01-11 Thread Kay C Lan
On Fri, Jan 9, 2015 at 8:22 AM, Peter Haworth wrote: > > [the]{3}\s(\w+)\s.*?(?=;) > > Using matchText in LC 6.5.2 it fails with error 301 pattern error. > Works fine in LC 7.0.1 on OS X 10.9.5 ___ use-livecode mailing list use-livecode@lists.runrev.co

Re: replaceText problem

2015-01-08 Thread Peter Haworth
On Tue, Jan 6, 2015 at 6:05 PM, Kay C Lan wrote: > LC uses the PCRE > implementation of regex. Yes there are different flavours of regex which is > why I like this online regex tester: > > https://regex101.com/#pcre > I've been using this site today to test out various examples while modifying t

Re: replaceText problem

2015-01-08 Thread Bob Sneidar
oookaay… so I’m beginning to see why I have a sock with embroidered flowers on it… Bob S On Jan 7, 2015, at 14:00 , J. Landman Gay mailto:jac...@hyperactivesw.com>> wrote: But the last time I tried it, I found *your* socks. On 1/7/2015 2:58 PM, Bob Sneidar wrote: The Jacqueline Landman Gay o

Re: replaceText problem

2015-01-07 Thread Geoff Canyon
On Tue, Jan 6, 2015 at 12:41 PM, J. Landman Gay wrote: > I know of one person who uses it in scripts. I find that difficult to read > and debug. > Unless you're already thinking of me, you know two. I will *very* occasionally do something like: put 10 into X; put 20 into Y _

Re: replaceText problem

2015-01-07 Thread Mark Wieder
Jacque- Tuesday, January 6, 2015, 8:36:43 PM, you wrote: > On 1/6/2015 9:58 PM, Mark Wieder wrote: >> Then in your traceBreak function you can parse it and do what you >> like. > No, no. In YOUR tracebreak function. I don't mess around in there, it's > too scary. You're the brave daredevil. We

Re: replaceText problem

2015-01-07 Thread Mark Wieder
Bob- Wednesday, January 7, 2015, 12:58:48 PM, you wrote: > The Jacqueline Landman Gay of the future uses them extensively in > her Time Travel Stack. If you don’t figure it out soon you will > never find your socks. I have enough trouble finding them as it is. -- -Mark Wieder ahsoftw...@gmail

Re: replaceText problem

2015-01-07 Thread J. Landman Gay
But the last time I tried it, I found *your* socks. On 1/7/2015 2:58 PM, Bob Sneidar wrote: The Jacqueline Landman Gay of the future uses them extensively in her Time Travel Stack. If you don’t figure it out soon you will never find your socks. Bob S On Jan 6, 2015, at 20:36 , J. Landman Gay

Re: replaceText problem

2015-01-07 Thread Bob Sneidar
The Jacqueline Landman Gay of the future uses them extensively in her Time Travel Stack. If you don’t figure it out soon you will never find your socks. Bob S On Jan 6, 2015, at 20:36 , J. Landman Gay mailto:jac...@hyperactivesw.com>> wrote: On 1/6/2015 9:58 PM, Mark Wieder wrote: Then in you

Re: replaceText problem

2015-01-07 Thread Bob Sneidar
Oh right, I knew about that. Bob S > On Jan 6, 2015, at 10:41 , J. Landman Gay wrote: > > On 1/6/2015 10:47 AM, Bob Sneidar wrote: >> There is a semicolon “trick”?? > > Yes, you can separate statement lines in scripts with a semicolon instead of > a return character. It's most useful in the

Re: replaceText problem

2015-01-06 Thread J. Landman Gay
On 1/6/2015 9:58 PM, Mark Wieder wrote: Then in your traceBreak function you can parse it and do what you like. No, no. In YOUR tracebreak function. I don't mess around in there, it's too scary. You're the brave daredevil. -- Jacqueline Landman Gay | jac...@hyperactivesw.com Hype

Re: replaceText problem

2015-01-06 Thread Mark Wieder
Jacque- Saturday, January 3, 2015, 9:53:38 PM, you wrote: > On 1/3/2015 5:52 PM, Mark Wieder wrote: >> Breakpoints don't have to be on a line by themselves. Haven't for >> several years now. For a while I toyed with having both breakpoints >> and tracepoints (log the context without stopping) by

Re: replaceText problem

2015-01-06 Thread Mike Bonner
Yeah, the regexbuilder is one of the plugins. Didn't know you could start the builder from find, will have to poke around. It would be very cool if someone (he says whistling nonchalantly and looking at the floor) updated the regex builder. On Tue, Jan 6, 2015 at 8:34 PM, Peter Haworth wrote: >

Re: replaceText problem

2015-01-06 Thread Peter Haworth
Hi Mike, That's one of RunRev's plugins, right? Sounds like a ripe candidate to be updated by some kind person :-) Interestingly I was prowling around the code for the Script Editor Find function a couple of days ago, the one you get when you click the more button, and came across a button that in

Re: replaceText problem

2015-01-06 Thread Mike Bonner
Ah k. My mistake again, works with the simplified old filter, not the current full regex filter. On Tue, Jan 6, 2015 at 8:16 PM, Mike Bonner wrote: > My mistake. Works with filter too. :) > > On Tue, Jan 6, 2015 at 8:13 PM, Mike Bonner wrote: > >> The regex builder thats part of LC is pretty go

Re: replaceText problem

2015-01-06 Thread Mike Bonner
My mistake. Works with filter too. :) On Tue, Jan 6, 2015 at 8:13 PM, Mike Bonner wrote: > The regex builder thats part of LC is pretty good for immediate feedback > too, and has the benefit that it can place (hopefull working) code into the > clipboard for pasting into script, after choosing ma

Re: replaceText problem

2015-01-06 Thread Mike Bonner
The regex builder thats part of LC is pretty good for immediate feedback too, and has the benefit that it can place (hopefull working) code into the clipboard for pasting into script, after choosing matchtext or matchchunk. (still helpful for figuring out the regex for filter, though no autogenerat

Re: replaceText problem

2015-01-06 Thread Peter Haworth
On Tue, Jan 6, 2015 at 6:47 PM, Kay C Lan wrote: > yeah, I use a local app - RegExhibit That's the one I use too. Pete lcSQL Software Home of lcStackBrowser and SQLiteAdmin ___

Re: replaceText problem

2015-01-06 Thread Kay C Lan
On Wed, Jan 7, 2015 at 10:31 AM, Peter Haworth wrote: > Good web site Kay, I've always used a local program on my Mac in the past > but that works better. > yeah, I use a local app - RegExhibit http://roger-jolly.nl/software/ for basic regex but for anything more complex I go to the site, main

Re: replaceText problem

2015-01-06 Thread Peter Haworth
On Tue, Jan 6, 2015 at 6:05 PM, Kay C Lan wrote: > I don't know where Pete was reading that certain regex characters are not > supported > It's in a dictionary note. However the note is not very clear. What it means is that if you are using matchtext with a character that is a regex special ch

Re: replaceText problem

2015-01-06 Thread Kay C Lan
On Wed, Jan 7, 2015 at 12:44 AM, Bob Sneidar wrote: > I read up on this, thinking that LC was implementing some substandard > regex functionality. Turns out this is the state of affairs in the regex > world. > > I don't know where Pete was reading that certain regex characters are not supported,

Re: replaceText problem

2015-01-06 Thread J. Landman Gay
On 1/6/2015 10:47 AM, Bob Sneidar wrote: There is a semicolon “trick”?? Yes, you can separate statement lines in scripts with a semicolon instead of a return character. It's most useful in the one-line message box but can be inconsistent there, where it usually works but sometimes doesn't.

Re: replaceText problem

2015-01-06 Thread Peter Haworth
On Tue, Jan 6, 2015 at 8:46 AM, Bob Sneidar wrote: > filter without idea I feel like this sometimes. Pete lcSQL Software Home of lcStackBrowser and SQLiteAdmin

Re: replaceText problem

2015-01-06 Thread dunbarx
ved with a watchpoint. Craig -Original Message- From: Bob Sneidar To: How to use LiveCode Sent: Tue, Jan 6, 2015 12:07 pm Subject: Re: replaceText problem Actually it is possible to say: if myVar is true then breakpoint But your filter without idea is a good one. Bob S On Jan 3, 2015

Re: replaceText problem

2015-01-06 Thread Bob Sneidar
Lawyers using regex. ;-) Bob S On Jan 4, 2015, at 08:00 , Dr. Hawkins mailto:doch...@gmail.com>> wrote: Plain regex is wonderful! :) Quite seriously, I rarely get through a week at my law office without using it . . . -- Dr. Richard E. Hawkins, Esq. __

Re: replaceText problem

2015-01-06 Thread Bob Sneidar
There is a semicolon “trick”?? Bob S On Jan 3, 2015, at 11:12 , J. Landman Gay mailto:jac...@hyperactivesw.com>> wrote: Well, there could be a comment after it. And some rare individuals use the semicolon trick to combine lines unexpectedly. But this should work for any line that starts with

Re: replaceText problem

2015-01-06 Thread Bob Sneidar
Actually it is possible to say: if myVar is true then breakpoint But your filter without idea is a good one. Bob S On Jan 3, 2015, at 10:36 , J. Landman Gay mailto:jac...@hyperactivesw.com>> wrote: I see now. Do you have to use regex? Breakpoint commands are always on a line by themselves.

Re: replaceText problem

2015-01-06 Thread Bob Sneidar
I read up on this, thinking that LC was implementing some substandard regex functionality. Turns out this is the state of affairs in the regex world. Bob S On Jan 3, 2015, at 09:35 , Peter Haworth mailto:p...@lcsql.com>> wrote: Looking into this further as there's a note in the dictionary tha

Re: replaceText problem

2015-01-04 Thread Kay C Lan
On Mon, Jan 5, 2015 at 4:25 AM, Peter Haworth wrote: > > Back on the need for a put or a get with a function, it's interesting to > note that you don't have to do that in the message box. Executing - > replaceText("abc","c","z") - in the message box puts "abz" into the message > box result area

Re: replaceText problem

2015-01-04 Thread Peter Haworth
Hi Kay, To be honest, I've been through so many iterations of this that I don't remember for sure if the command I cited in my post was exactly what I had in the script at the time. I'd be almost certain that I had a "put" in there since I knew it was a function, but it's very possible that the ex

Re: replaceText problem

2015-01-04 Thread Dr. Hawkins
On Sat, Jan 3, 2015 at 2:01 PM, Peter M. Brigham wrote: > For me, even plain regex is like a trip to the dentist. With no novocaine. > I understand that it's powerful, but I have rarely come across something I > couldn't do in livecode less painfully. > Plain regex is wonderful! :) Quite seri

Re: replaceText problem

2015-01-03 Thread J. Landman Gay
On 1/3/2015 5:52 PM, Mark Wieder wrote: Breakpoints don't have to be on a line by themselves. Haven't for several years now. For a while I toyed with having both breakpoints and tracepoints (log the context without stopping) by passing a parameter to breakpoints. Interesting, how does that work

Re: replaceText problem

2015-01-03 Thread Kay C Lan
On Sat, Jan 3, 2015 at 10:41 AM, Peter Haworth wrote: > > replaceText(pScript,"(^\s*breakpoint$"," ") > > Hi Peter, If this is exactly how your script is written then I see two problems: 1) you need to actually put the result into something so: put replaceText(pScript,"(?im)^\s+breakpoint$","-

Re: replaceText problem

2015-01-03 Thread Mark Wieder
Jacque- Breakpoints don't have to be on a line by themselves. Haven't for several years now. For a while I toyed with having both breakpoints and tracepoints (log the context without stopping) by passing a parameter to breakpoints. >filter tScript without "*breakpoint*" But that incantation

Re: replaceText problem

2015-01-03 Thread Peter M. Brigham
On Jan 3, 2015, at 4:44 PM, Dr. Hawkins wrote: > I haven't had to deal with multi-line regex in several years, but recall it > being like a trip to the dentist. For me, even plain regex is like a trip to the dentist. With no novocaine. I understand that it's powerful, but I have rarely come acro

Re: replaceText problem

2015-01-03 Thread Dr. Hawkins
On Sat, Jan 3, 2015 at 12:23 PM, Peter Haworth wrote: > I had to include "(?m)" at the start of the regex in order to to make it > work in multiline mode. > > The "^" at the start of my regex means "start of line" but unless you are > in multiline mode, line breaks aren't recognized by regex. >

Re: replaceText problem

2015-01-03 Thread Peter Haworth
I finally got replaceText working although still not sure why it returned a runtime error. I had to include "(?m)" at the start of the regex in order to to make it work in multiline mode. The "^" at the start of my regex means "start of line" but unless you are in multiline mode, line breaks aren

Re: replaceText problem

2015-01-03 Thread Dr. Hawkins
On Sat, Jan 3, 2015 at 10:53 AM, Peter Haworth wrote: > Sounds like filter with the same regex would work and just set the script > to the filtered version, thanks fot the idea.. > Is there any whitespace that could occur before breakpoint other than space? that would let the simpler expression

Re: replaceText problem

2015-01-03 Thread Peter Haworth
That would work fine for me since I don't recall ever having anything else on a line that has a breakpoint. I actually hardly ever use that command anyway, only in the circumstances where a red dot breakpoint doesn't trigger which, as others have mentioned, does happen sometimes. Pete lcSQL Softw

Re: replaceText problem

2015-01-03 Thread J. Landman Gay
On 1/3/2015 1:06 PM, Peter M. Brigham wrote: Well, you actually can do this: if the shiftkey is down then breakpoint Whether you should is another matter. Oh right. So instead of my other suggestion: filter tScript without "*breakpoint*" It will destroy any lines that incorporate semic

Re: replaceText problem

2015-01-03 Thread J. Landman Gay
On 1/3/2015 12:53 PM, Peter Haworth wrote: I didn't know breakpoint was always on a line by itself - so you can't have another command on the same line separated by a comma? Kinda moot anyway since I'd never do that and this will only ever be working on my scripts. Well, there could be a comme

Re: replaceText problem

2015-01-03 Thread Peter M. Brigham
On Jan 3, 2015, at 1:36 PM, J. Landman Gay wrote: > On 1/3/2015 11:35 AM, Peter Haworth wrote: >> It's part of a script I use to get a product ready for release. I'm >> already calling revDebuggerClearAllBreakpoints (which I think is what is >> called when you select the Clear All Breakpoints men

Re: replaceText problem

2015-01-03 Thread Peter Haworth
I may have to go that route since I just can't get replaceText to work. I didn't know breakpoint was always on a line by itself - so you can't have another command on the same line separated by a comma? Kinda moot anyway since I'd never do that and this will only ever be working on my scripts. S

Re: replaceText problem

2015-01-03 Thread J. Landman Gay
On 1/3/2015 11:35 AM, Peter Haworth wrote: It's part of a script I use to get a product ready for release. I'm already calling revDebuggerClearAllBreakpoints (which I think is what is called when you select the Clear All Breakpoints menu option) but I think that only clears red dot breakpoints n

Re: replaceText problem

2015-01-03 Thread Peter Haworth
Hi Jacque, It's part of a script I use to get a product ready for release. I'm already calling revDebuggerClearAllBreakpoints (which I think is what is called when you select the Clear All Breakpoints menu option) but I think that only clears red dot breakpoints not breakpoint commands. Looking i

Re: replaceText problem

2015-01-03 Thread Dr. Hawkins
On Fri, Jan 2, 2015 at 7:41 PM, J. Landman Gay wrote: > Is this for your own use, or for a utility? The capability is already > built into the debugger -- just choose "Clear all breakpoints" from the > Debug menu. It removes all breakpoints from all scripts in all open stacks. He's searching fo

Re: replaceText problem

2015-01-02 Thread J. Landman Gay
On 1/2/2015 8:41 PM, Peter Haworth wrote: I'm adding a check for breakpoint commands to my build procedures. Basically check through the command of every script and issue the following command: Is this for your own use, or for a utility? The capability is already built into the debugger -- jus

replaceText problem

2015-01-02 Thread Peter Haworth
I'm adding a check for breakpoint commands to my build procedures. Basically check through the command of every script and issue the following command: replaceText(pScript,"(^\s*breakpoint$"," ") It looks for some number of space at the start of a line, followed by the word breakpoint, then the e