Re: Finding orphaned "put"

2013-05-06 Thread Richard Gaskin
IIRC the trick with revMessageBoxRedirect is to obtain the value of the 
Message Box contents from the global variable "message" (or "msg").


--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for Desktop, Mobile, and Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Finding orphaned "put"

2013-05-06 Thread Alex Tweedly
I can't quite seem to figure out how that works. (With both 5.5.3 and 
6.0, I get the following )


If I set revMessageBoxRedirect to the long ID of a field, then the 
contents of the field get updated as though it had been the message box; 
i.e. the field is updated, but there is no "msgChanged" message sent. 
(Not received by a handler in the field, and not shown by Development / 
Watch Messages).


If I set revMessageBoxRedirect to the long ID of a button then the 
button does receive "msgChanged" messages - but there are no parameters 
passed.


Maybe I'm missing something - but the code I'm testing with is pretty simple

(in my Button script)
on mouseUp
   if revMessageBoxRedirect is empty then
  set revMessageBoxRedirect to the long ID of me
   else
  set revMessageBoxRedirect to empty
   end if
end mouseUp

on msgChanged p
   put "got" && paramcount() && p &CR after field "F"
end msgChanged

(or change "long ID of me" to "long ID of field "F"" to test the other 
case).


-- Alex.


On 06/05/2013 23:56, Richard Gaskin wrote:
Another option would be to use the revMessageBoxRedirect global 
property, and catch the executionContexts from your specified object:




--
 Richard Gaskin
 Fourth World
 LiveCode training and consulting: http://www.fourthworld.com
 Webzine for LiveCode developers: http://www.LiveCodeJournal.com
 Follow me on Twitter:  http://twitter.com/FourthWorldSys

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your 
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-livecode



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Finding orphaned "put"

2013-05-06 Thread Paul Maguire
On 6 May 2013, at 22:39, J. Landman Gay wrote:
> I was just talking to someone today who is also fleeing Director

Director is great. There is nothing else like it. It's Adobe that are the 
problem.

Kind regards,   Paul.
---
Paul Maguire
http://www.paulmaguire.me

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Finding orphaned "put"

2013-05-06 Thread Richard Gaskin
Another option would be to use the revMessageBoxRedirect global 
property, and catch the executionContexts from your specified object:




--
 Richard Gaskin
 Fourth World
 LiveCode training and consulting: http://www.fourthworld.com
 Webzine for LiveCode developers: http://www.LiveCodeJournal.com
 Follow me on Twitter:  http://twitter.com/FourthWorldSys

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Finding orphaned "put"

2013-05-06 Thread Mark Wieder
Alex Tweedly  writes:

> Having had the great idea of keeping this info, someone should have said
> 
> "let's keep that info for *every* line (actually, every section) of 
> output in the msg box"

I like the idea. As currently written, there's a single system property
called "revmessageboxlastobject" that contains three items:

long id, handler, line number

Unfortunately, since it's a system property it's part of the engine and so a
scripted workaround won't work. It would be nice to have an array instead.

> and then have the "target" button take you to the line number in the 
> script for any specified line.

Well, it sort of does, but instead of the line number in the property being
the actual line number in the text it's the line number inside the handler.
So the button takes you to the wrong line in the script unless you happen to
be dealing with the first handler in the script and there's nothing (no
empty lines, etc.) before it. I like it as a proof of concept, though.

-- 
 Mark Wieder
 mwie...@ahsoftware.net



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Finding orphaned "put"

2013-05-06 Thread J. Landman Gay

On 5/6/13 1:55 PM, Paul Maguire wrote:


Thanks for this. Putting stuff in Director (my other life) has an
impact on engine speed, especially if it is a large string.


I was just talking to someone today who is also fleeing Director. He's 
moving everything to LiveCode now.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Finding orphaned "put"

2013-05-06 Thread J. Landman Gay

On 5/6/13 3:03 PM, Mark Wieder wrote:

Alex Tweedly  writes:


I personally don't use it (yet?), because I *never* use orphaned "put"s,


I don't either. I can't imagine where they keep coming from. I think maybe
it's the adult stage of larval lost socks.



They're coming from me, guys. I use orphaned "puts" sometimes. Usually I 
PUT IN ALL CAPS WITH A SPECIAL COMMENT --### so I can find them later 
but if some of them escape, you never know where they'll end up.


I think my socks are behind the dryer, so who knows what they're turning 
into.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Finding orphaned "put"

2013-05-06 Thread Mark Wieder
Alex Tweedly  writes:

> I personally don't use it (yet?), because I *never* use orphaned "put"s, 

I don't either. I can't imagine where they keep coming from. I think maybe
it's the adult stage of larval lost socks.

-- 
 Mark Wieder
 mwie...@ahsoftware.net




___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Finding orphaned "put"

2013-05-06 Thread Paul Maguire
On 6 May 2013, at 17:17, J. Landman Gay wrote:
> On 5/6/13 6:33 AM, Paul Maguire wrote:
>> My simple question is - does putting stuff slowdown runtime
>> performance? 
> It shouldn't make a dent in the speed, it's just pushing thing to stdout. The 
> engine is very fast. One of the (relatively) slowest things to do is 
> read/write to fields, and you aren't doing that.

Thanks for this. Putting stuff in Director (my other life) has an impact on 
engine speed, especially if it is a large string.

Kind regards,   Paul.


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Finding orphaned "put"

2013-05-06 Thread J. Landman Gay

On 5/6/13 6:33 AM, Paul Maguire wrote:

This was a good thread - ta!

My simple question is - does putting stuff slowdown runtime
performance? In my first bit of iOS/Android development I'm putting
stuff all the time and checking it in Console to help debug...


It shouldn't make a dent in the speed, it's just pushing thing to 
stdout. The engine is very fast. One of the (relatively) slowest things 
to do is read/write to fields, and you aren't doing that.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Finding orphaned "put"

2013-05-06 Thread Paul Maguire
This was a good thread - ta! 

My simple question is - does putting stuff slowdown runtime performance? In my 
first bit of iOS/Android development I'm putting stuff all the time and 
checking it in Console to help debug...

Kind regards,   Paul.
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Finding orphaned "put"

2013-05-05 Thread Alex Tweedly

I agree it's not been hyped (or praised) as much as it deserves.

But, it's also not as good as it should have been :-(

Having had the great idea of keeping this info, someone should have said

   "let's keep that info for *every* line (actually, every section) of 
output in the msg box"


and then have the "target" button take you to the line number in the 
script for any specified line.
(And in fact, why not keep the whole executioncontexts, and the 
millisecs, for every bit of output with some way to access it all when 
needed ??)


I personally don't use it (yet?), because I *never* use orphaned "put"s, 
I always use my own library handler(s) that gather output, show it in 
the msg box or log it in a file or show it in a field or discard it  
depending on the environment and on my own settings.


Upgrading my handlers to include some or all of the executioncontexts 
info is definitely on my to-do list 
   ... and tidying up these handlers to the point I could release them 
somewhere is too, but somewhat lower in priority).


-- Alex.

On 05/05/2013 02:55, Mark Wieder wrote:

Jerry-

Saturday, May 4, 2013, 6:40:52 PM, you wrote:


SWEET! That got me to download 6.

It's a very cool feature, and one that I don't think has been hyped
enough.




___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Finding orphaned "put"

2013-05-05 Thread Peter Haworth
Hi William,
Academic at this point but I couldn't resist improving this a bit!  I can
make it exclude single line comments starting with "--" (or whatever you
use for comment indicators) but can't think of a way to deal with block
comments, or comments part way through a line.  Here's the regexp for that:

(?im)^(?!--)\s*put\s((?!(into|after|before|\\)).)*$

I'm not sure why it didn't work for you in LC (excluding "after" and
"before") - seemed to work OK for me.

I used to automatically switch off when regular expressions were mentioned
because they look dauntingly cryptic.  But I found that with a fairly short
amount of time learning the syntax they're pretty easy to understand and
amazingly powerful.  Great for validating user input.

Pete
lcSQL Software 


On Sat, May 4, 2013 at 7:30 PM, william humphrey  wrote:

> But (?im)^\s*put\s((?!(into|after|before|\\)).)*$ -- works perfectly in
> BBedit. Thank you very much (just doesn't work in live code perhaps because
> I don't know how to tell livecode to use Regex in the find feature).
>
> On Sat, May 4, 2013 at 10:24 PM, william humphrey <
> b...@bluewatermaritime.com> wrote:
>
> > (?im)^\s*put\s((?!(after|into|before|\\)).)*$
> >
> >
> > the after|into|before , guessing the vertical bar means "or" but is not
> > working. It only works for whatever the first word is and then still
> finds
> > the next two.
> >
>
>
>
> --
> http://www.bluewatermaritime.com
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Finding orphaned "put"

2013-05-04 Thread J. Landman Gay

On 5/4/13 9:14 PM, william humphrey wrote:


The target button would be wonderful but since the message box comes up,
but nothing is in it when it does, maybe that makes it not work.


It works for me here. It sounds like the "put" is putting empty into the 
message box, which is too bad. It would have been an easy solution.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Finding orphaned "put"

2013-05-04 Thread Jerry Jensen
On May 4, 2013, at 7:24 PM, william humphrey  wrote:

> (?im)^\s*put\s((?!(after|into|before|\\)).)*$

Gesundheit!


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Finding orphaned "put"

2013-05-04 Thread william humphrey
But (?im)^\s*put\s((?!(into|after|before|\\)).)*$ -- works perfectly in
BBedit. Thank you very much (just doesn't work in live code perhaps because
I don't know how to tell livecode to use Regex in the find feature).

On Sat, May 4, 2013 at 10:24 PM, william humphrey <
b...@bluewatermaritime.com> wrote:

> (?im)^\s*put\s((?!(after|into|before|\\)).)*$
>
>
> the after|into|before , guessing the vertical bar means "or" but is not
> working. It only works for whatever the first word is and then still finds
> the next two.
>



-- 
http://www.bluewatermaritime.com
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Finding orphaned "put"

2013-05-04 Thread william humphrey
(?im)^\s*put\s((?!(after|into|before|\\)).)*$


the after|into|before , guessing the vertical bar means "or" but is not
working. It only works for whatever the first word is and then still finds
the next two.
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Finding orphaned "put"

2013-05-04 Thread william humphrey
(?im)^\s*put\s((?!(into|after|before|\\)).)*$  is wonderful but gives me
450 lines to look through (admittedly less than 6500). Found lots of
commented code and lines like:

 *put* tHolder2 & *return* after tAllCargoLines_Processed


which have the word "after" so I don't get it.


The target button would be wonderful but since the message box comes up,
but nothing is in it when it does, maybe that makes it not work.



On Sat, May 4, 2013 at 9:55 PM, Mark Wieder  wrote:

> Jerry-
>
> Saturday, May 4, 2013, 6:40:52 PM, you wrote:
>
> > SWEET! That got me to download 6.
>
> It's a very cool feature, and one that I don't think has been hyped
> enough.
>
> --
> -Mark Wieder
>
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Finding orphaned "put"

2013-05-04 Thread Mark Wieder
Jerry-

Saturday, May 4, 2013, 6:40:52 PM, you wrote:

> SWEET! That got me to download 6.

It's a very cool feature, and one that I don't think has been hyped
enough.

-- 
-Mark Wieder
 mwie...@ahsoftware.net


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Finding orphaned "put"

2013-05-04 Thread Jerry Jensen
On May 4, 2013, at 2:58 PM, Alex Tweedly  wrote

> 6.0 contains a new feature (which I've not yet used :-) - in the message box 
> there is a button (top right, looks kind of like a target symbol)
> when you click it, the editor shows you the source script line that caused 
> the last output.

SWEET! That got me to download 6.

.Jerry



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Finding orphaned "put"

2013-05-04 Thread J. Landman Gay
Peter Haworth  wrote:

>But that requires him to know how to execute the code that puts to the
>message box - if he knew that, he'd know where to look to delete it :-)
>
>Pete
>lcSQL Software 
>
>
>On Sat, May 4, 2013 at 3:05 PM, J. Landman Gay
>wrote:
>
>> On 5/4/13 3:35 PM, william humphrey wrote:
>>
>>> Grep is way to difficult to use for this. And it isn't just "into"
>it's
>>> also "after".  I'm back to wishing there was a way to turn off the
>message
>>> box feature of being called without explicitly calling it. It is
>truly
>>> evil.
>>>
>>
>> If you are using LiveCode 6, run your scripts until the message box
>pops
>> up. Then click the little target-looking icon at the left of the
>top-right
>> group of icons, and it should take you to the line of script.
>>
>> --
>> Jacqueline Landman Gay | jac...@hyperactivesw.com
>> HyperActive Software   | http://www.hyperactivesw.com
>>
>>
>> __**_
>> use-livecode mailing list
>> use-livecode@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>>
>http://lists.runrev.com/**mailman/listinfo/use-livecode
>>
>___
>use-livecode mailing list
>use-livecode@lists.runrev.com
>Please visit this url to subscribe, unsubscribe and manage your
>subscription preferences:
>http://lists.runrev.com/mailman/listinfo/use-livecode

Well, he said the message box kept popping up but he couldn't find from where.  
The next time it happens all he has to do is click the target button.  :-) 
-- 
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Finding orphaned "put"

2013-05-04 Thread Peter Haworth
Sorry, I meant "\", not "/"

Pete
lcSQL Software 


On Sat, May 4, 2013 at 5:15 PM, Peter Haworth  wrote:

> Hi Scott,
> This will list lines that have a continuation char - "/" - at the end with
> into/after/before on the next line.  Pretty remote circumstance but I tend
> to do that if I have a particularly long source with lots of "&" and "&&"
> to make it more readable.
>
> Still think the regexp approach is the easiest - no scripts, just uses
> standard script editor find function to look  in the current object, stack,
> stack file, etc.
>
>
> Pete
> lcSQL Software 
>
>
> On Sat, May 4, 2013 at 4:29 PM, Scott Rossi wrote:
>
>> Here's a script I use that answers the offending line(s) of script with
>> line numbers:
>>
>> on mouseUp
>>   put script of  into S
>>   put empty into temp
>>   put 1 into N
>>   repeat for each line L in S
>> if "put" is in L and ("into" is not in L and "after" is not in L and
>> "before" is not in L) then
>>   put "Line" && N & cr & L & cr & cr after temp
>> end if
>> add 1 to N
>>   end repeat
>>   if temp is empty then
>> answer "All clear!"
>>   else answer temp
>> end mouseUp
>>
>>
>>
>> Regards,
>>
>> Scott Rossi
>> Creative Director
>> Tactile Media, UX/UI Design
>>
>>
>>
>>
>> On 5/4/13 1:05 PM, "william humphrey"  wrote:
>>
>> >I remember reading somewhere that version 6.0 or maybe GLX2 script editor
>> >has a way to find an orphaned "put".  Anybody have any suggestions? If I
>> >search for every "put" in my 6500 lines of code it will take a while and
>> >my
>> >eyes will go blurry reading each one to check if it is putting to the
>> >message box or not. Maybe there would be a way to "turn off" having a PUT
>> >go right to the message box unless you say "put variable in the message
>> >box"?
>> >___
>> >use-livecode mailing list
>> >use-livecode@lists.runrev.com
>> >Please visit this url to subscribe, unsubscribe and manage your
>> >subscription preferences:
>> >http://lists.runrev.com/mailman/listinfo/use-livecode
>> >
>>
>>
>>
>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Finding orphaned "put"

2013-05-04 Thread Peter Haworth
Hi Scott,
This will list lines that have a continuation char - "/" - at the end with
into/after/before on the next line.  Pretty remote circumstance but I tend
to do that if I have a particularly long source with lots of "&" and "&&"
to make it more readable.

Still think the regexp approach is the easiest - no scripts, just uses
standard script editor find function to look  in the current object, stack,
stack file, etc.


Pete
lcSQL Software 


On Sat, May 4, 2013 at 4:29 PM, Scott Rossi  wrote:

> Here's a script I use that answers the offending line(s) of script with
> line numbers:
>
> on mouseUp
>   put script of  into S
>   put empty into temp
>   put 1 into N
>   repeat for each line L in S
> if "put" is in L and ("into" is not in L and "after" is not in L and
> "before" is not in L) then
>   put "Line" && N & cr & L & cr & cr after temp
> end if
> add 1 to N
>   end repeat
>   if temp is empty then
> answer "All clear!"
>   else answer temp
> end mouseUp
>
>
>
> Regards,
>
> Scott Rossi
> Creative Director
> Tactile Media, UX/UI Design
>
>
>
>
> On 5/4/13 1:05 PM, "william humphrey"  wrote:
>
> >I remember reading somewhere that version 6.0 or maybe GLX2 script editor
> >has a way to find an orphaned "put".  Anybody have any suggestions? If I
> >search for every "put" in my 6500 lines of code it will take a while and
> >my
> >eyes will go blurry reading each one to check if it is putting to the
> >message box or not. Maybe there would be a way to "turn off" having a PUT
> >go right to the message box unless you say "put variable in the message
> >box"?
> >___
> >use-livecode mailing list
> >use-livecode@lists.runrev.com
> >Please visit this url to subscribe, unsubscribe and manage your
> >subscription preferences:
> >http://lists.runrev.com/mailman/listinfo/use-livecode
> >
>
>
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Finding orphaned "put"

2013-05-04 Thread Peter Haworth
But that requires him to know how to execute the code that puts to the
message box - if he knew that, he'd know where to look to delete it :-)

Pete
lcSQL Software 


On Sat, May 4, 2013 at 3:05 PM, J. Landman Gay wrote:

> On 5/4/13 3:35 PM, william humphrey wrote:
>
>> Grep is way to difficult to use for this. And it isn't just "into" it's
>> also "after".  I'm back to wishing there was a way to turn off the message
>> box feature of being called without explicitly calling it. It is truly
>> evil.
>>
>
> If you are using LiveCode 6, run your scripts until the message box pops
> up. Then click the little target-looking icon at the left of the top-right
> group of icons, and it should take you to the line of script.
>
> --
> Jacqueline Landman Gay | jac...@hyperactivesw.com
> HyperActive Software   | http://www.hyperactivesw.com
>
>
> __**_
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/**mailman/listinfo/use-livecode
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Finding orphaned "put"

2013-05-04 Thread Peter Haworth
William,
Just tried out the regexp I gave you and found it needs a couple of changes
to deal with case insensitivity, looking for "before" and also dealing with
the LC script continuation char "\" which could occur at the end of a line
before the into/after/before.

The new version of the regexp is:

(?im)^\s*put\s((?!(into|after|before|\\)).)*$

It works very nicely since doing it this way lists the object and line
number of the offending script line so it's easy to go directly to them and
delete them. I discoverved a couple of orphaned puts lurking in some old
code I had!  I think I will put this check into my release procedures.



Pete
lcSQL Software 


On Sat, May 4, 2013 at 2:29 PM, Jerry Jensen  wrote:

> On May 4, 2013, at 1:35 PM, william humphrey 
> wrote:
>
> > Grep is way to difficult to use for this. And it isn't just "into" it's
> > also "after".
>
> And also "before". Also a bunch of other things that you can see in the
> dictionary by finding "put". Also require white space before and after so
> you don't get stuff like "input" or "output" for us audio nerds.
> .Jerry
>
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Finding orphaned "put"

2013-05-04 Thread Scott Rossi
Here's a script I use that answers the offending line(s) of script with
line numbers:

on mouseUp
  put script of  into S
  put empty into temp
  put 1 into N
  repeat for each line L in S
if "put" is in L and ("into" is not in L and "after" is not in L and
"before" is not in L) then
  put "Line" && N & cr & L & cr & cr after temp
end if
add 1 to N
  end repeat
  if temp is empty then
answer "All clear!"
  else answer temp
end mouseUp



Regards,

Scott Rossi
Creative Director
Tactile Media, UX/UI Design




On 5/4/13 1:05 PM, "william humphrey"  wrote:

>I remember reading somewhere that version 6.0 or maybe GLX2 script editor
>has a way to find an orphaned "put".  Anybody have any suggestions? If I
>search for every "put" in my 6500 lines of code it will take a while and
>my
>eyes will go blurry reading each one to check if it is putting to the
>message box or not. Maybe there would be a way to "turn off" having a PUT
>go right to the message box unless you say "put variable in the message
>box"?
>___
>use-livecode mailing list
>use-livecode@lists.runrev.com
>Please visit this url to subscribe, unsubscribe and manage your
>subscription preferences:
>http://lists.runrev.com/mailman/listinfo/use-livecode
>



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Finding orphaned "put"

2013-05-04 Thread J. Landman Gay

On 5/4/13 3:35 PM, william humphrey wrote:

Grep is way to difficult to use for this. And it isn't just "into" it's
also "after".  I'm back to wishing there was a way to turn off the message
box feature of being called without explicitly calling it. It is truly evil.


If you are using LiveCode 6, run your scripts until the message box pops 
up. Then click the little target-looking icon at the left of the 
top-right group of icons, and it should take you to the line of script.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Finding orphaned "put"

2013-05-04 Thread Alex Tweedly
6.0 contains a new feature (which I've not yet used :-) - in the message 
box there is a button (top right, looks kind of like a target symbol)
when you click it, the editor shows you the source script line that 
caused the last output.


That might help you in this case 

-- Alex.

On 04/05/2013 21:05, william humphrey wrote:

I remember reading somewhere that version 6.0 or maybe GLX2 script editor
has a way to find an orphaned "put".  Anybody have any suggestions? If I
search for every "put" in my 6500 lines of code it will take a while and my
eyes will go blurry reading each one to check if it is putting to the
message box or not. Maybe there would be a way to "turn off" having a PUT
go right to the message box unless you say "put variable in the message
box"?
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Finding orphaned "put"

2013-05-04 Thread Mark Wieder
william-

Saturday, May 4, 2013, 1:15:47 PM, you wrote:

> I have many lines of script which say "put something into variable"

> I have one line of script which just says "put variable" - what that does
> is open the message box. I'd like to find that line of script and delete
> it.

> Could I really put 6000 lines of script in a variable?

Yep. I occasionally need to put 11000 lines into a variable.
Anyway,

put theScript into tVariable
filter tVariable with "put*"
filter tVariable without "* into *"
filter tVariable without "* before *"
filter tVariable without "* after *"
if the number of lines in tVariable is 1 then
  find tVariable
end if

should get you close.

-- 
-Mark Wieder
 mwie...@ahsoftware.net


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Finding orphaned "put"

2013-05-04 Thread Jerry Jensen
On May 4, 2013, at 1:35 PM, william humphrey  wrote:

> Grep is way to difficult to use for this. And it isn't just "into" it's
> also "after".

And also "before". Also a bunch of other things that you can see in the 
dictionary by finding "put". Also require white space before and after so you 
don't get stuff like "input" or "output" for us audio nerds.
.Jerry


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Finding orphaned "put"

2013-05-04 Thread Peter Haworth
Hi WIlliam,
You should be able to find your orphaned puts using a regular expression in
the Find box

In the script editor window, type command-F then click the More button and
the the expand arrow for iptions, then check the regular expression box.
 In the Find What box type:

^\s+put\s.((?!(into|after)).)*$

then click find all after setting the option menu to stack or whatever
scope you need for the find.  That should find any lines that start with
any number of spaces, then "put" and do not have the words "into" or
"after" in the same line.  This works in my regular expression test program
but haven't tried it in LC

Hope that helps

Pete
lcSQL Software 
PS I've been caught by this in the past and now have a "putmsg" handler
that I call when I want to put something in the message box.  Same for
answer dialogs I use for debugging purposes. Much easier to find those and
get rid of them.



On Sat, May 4, 2013 at 1:05 PM, william humphrey  wrote:

> I remember reading somewhere that version 6.0 or maybe GLX2 script editor
> has a way to find an orphaned "put".  Anybody have any suggestions? If I
> search for every "put" in my 6500 lines of code it will take a while and my
> eyes will go blurry reading each one to check if it is putting to the
> message box or not. Maybe there would be a way to "turn off" having a PUT
> go right to the message box unless you say "put variable in the message
> box"?
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Finding orphaned "put"

2013-05-04 Thread Dr. Hawkins
On Sat, May 4, 2013 at 1:05 PM, william humphrey
 wrote:
> I remember reading somewhere that version 6.0 or maybe GLX2 script editor
> has a way to find an orphaned "put".  Anybody have any suggestions? If I
> search for every "put" in my 6500 lines of code it will take a while and my
> eyes will go blurry reading each one to check if it is putting to the
> message box or not. Maybe there would be a way to "turn off" having a PUT
> go right to the message box unless you say "put variable in the message
> box"?

I've dealt with this by having a "ck" command.  I can variously set it
answer the argument, put the argument, or append to a field in a watch
window (or a combination of these)

If nothing else, I can find these with breakpoints . . .


-- 
Dr. Richard E. Hawkins, Esq.
(702) 508-8462

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Finding orphaned "put"

2013-05-04 Thread Robert Sneidar
You should be able to do this in lc. 

Put the script of  into 
-- repeat loop to put the line number of each line before eeach line in the 
variable
Filter  with "*put*"
Filter  without "*into*"

Put a loop around it for every object in you project and build a list of 
objects and line numbers. 

Sorry I'm doing this on an iPhone and its tedious but it all works in my mind. 
Besides, I've had 3 beers so it should work!

Bob Sneidar
IT Manager
Calvary Chapel CM
Sent from iPhone

On May 4, 2013, at 13:20, william humphrey  wrote:

> 2335 lines have the word "put". I haven't figured out how to tell BBedit to
> find just before a "return" and without the word "into".
> 
> On Sat, May 4, 2013 at 4:17 PM, Robert Sneidar  wrote:
> 
>> Off the top of my head, put the script into a variable. Filter with
>> "put*". Filter without "into". Not sure what you mean by orphaned.
>> 
>> Erm... Without "*into*"
>> 
>> Now that I think of it prolly have to filter for "*put*".
>> 
>> Bob Sneidar
>> IT Manager
>> Calvary Chapel CM
>> Sent from iPhone
>> 
>> On May 4, 2013, at 13:05, william humphrey 
>> wrote:
>> 
>>> I remember reading somewhere that version 6.0 or maybe GLX2 script editor
>>> has a way to find an orphaned "put".  Anybody have any suggestions? If I
>>> search for every "put" in my 6500 lines of code it will take a while and
>> my
>>> eyes will go blurry reading each one to check if it is putting to the
>>> message box or not. Maybe there would be a way to "turn off" having a PUT
>>> go right to the message box unless you say "put variable in the message
>>> box"?
>>> ___
>>> use-livecode mailing list
>>> use-livecode@lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>> 
>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> 
> 
> 
> -- 
> http://www.bluewatermaritime.com
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Finding orphaned "put"

2013-05-04 Thread william humphrey
Grep is way to difficult to use for this. And it isn't just "into" it's
also "after".  I'm back to wishing there was a way to turn off the message
box feature of being called without explicitly calling it. It is truly evil.

On Sat, May 4, 2013 at 4:20 PM, william humphrey  wrote:

> 2335 lines have the word "put". I haven't figured out how to tell BBedit
> to find just before a "return" and without the word "into".
>
>
> On Sat, May 4, 2013 at 4:17 PM, Robert Sneidar  wrote:
>
>> Off the top of my head, put the script into a variable. Filter with
>> "put*". Filter without "into". Not sure what you mean by orphaned.
>>
>> Erm... Without "*into*"
>>
>> Now that I think of it prolly have to filter for "*put*".
>>
>> Bob Sneidar
>> IT Manager
>> Calvary Chapel CM
>> Sent from iPhone
>>
>> On May 4, 2013, at 13:05, william humphrey 
>> wrote:
>>
>> > I remember reading somewhere that version 6.0 or maybe GLX2 script
>> editor
>> > has a way to find an orphaned "put".  Anybody have any suggestions? If I
>> > search for every "put" in my 6500 lines of code it will take a while
>> and my
>> > eyes will go blurry reading each one to check if it is putting to the
>> > message box or not. Maybe there would be a way to "turn off" having a
>> PUT
>> > go right to the message box unless you say "put variable in the message
>> > box"?
>> > ___
>> > use-livecode mailing list
>> > use-livecode@lists.runrev.com
>> > Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> > http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>
>
>
> --
> http://www.bluewatermaritime.com




-- 
http://www.bluewatermaritime.com
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Finding orphaned "put"

2013-05-04 Thread william humphrey
2335 lines have the word "put". I haven't figured out how to tell BBedit to
find just before a "return" and without the word "into".

On Sat, May 4, 2013 at 4:17 PM, Robert Sneidar  wrote:

> Off the top of my head, put the script into a variable. Filter with
> "put*". Filter without "into". Not sure what you mean by orphaned.
>
> Erm... Without "*into*"
>
> Now that I think of it prolly have to filter for "*put*".
>
> Bob Sneidar
> IT Manager
> Calvary Chapel CM
> Sent from iPhone
>
> On May 4, 2013, at 13:05, william humphrey 
> wrote:
>
> > I remember reading somewhere that version 6.0 or maybe GLX2 script editor
> > has a way to find an orphaned "put".  Anybody have any suggestions? If I
> > search for every "put" in my 6500 lines of code it will take a while and
> my
> > eyes will go blurry reading each one to check if it is putting to the
> > message box or not. Maybe there would be a way to "turn off" having a PUT
> > go right to the message box unless you say "put variable in the message
> > box"?
> > ___
> > use-livecode mailing list
> > use-livecode@lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



-- 
http://www.bluewatermaritime.com
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Finding orphaned "put"

2013-05-04 Thread Robert Sneidar
Off the top of my head, put the script into a variable. Filter with "put*". 
Filter without "into". Not sure what you mean by orphaned.

Erm... Without "*into*"

Now that I think of it prolly have to filter for "*put*". 

Bob Sneidar
IT Manager
Calvary Chapel CM
Sent from iPhone

On May 4, 2013, at 13:05, william humphrey  wrote:

> I remember reading somewhere that version 6.0 or maybe GLX2 script editor
> has a way to find an orphaned "put".  Anybody have any suggestions? If I
> search for every "put" in my 6500 lines of code it will take a while and my
> eyes will go blurry reading each one to check if it is putting to the
> message box or not. Maybe there would be a way to "turn off" having a PUT
> go right to the message box unless you say "put variable in the message
> box"?
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Finding orphaned "put"

2013-05-04 Thread Mark Schonewille
William,

Write a repeat loop that loops through all stacks, cards and their controls and 
checks all scripts for a line that contains put but not into.

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
KvK: 50277553

Use Color Converter to convert CMYK, RGB, RAL, XYZ, H.Lab and other colour 
spaces. http://www.color-converter.com

We have time for new software development projects. Contact me for a quote.




On 4 mei 2013, at 22:05, william humphrey wrote:

> I remember reading somewhere that version 6.0 or maybe GLX2 script editor
> has a way to find an orphaned "put".  Anybody have any suggestions? If I
> search for every "put" in my 6500 lines of code it will take a while and my
> eyes will go blurry reading each one to check if it is putting to the
> message box or not. Maybe there would be a way to "turn off" having a PUT
> go right to the message box unless you say "put variable in the message
> box"?



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Finding orphaned "put"

2013-05-04 Thread william humphrey
I have many lines of script which say "put something into variable"

I have one line of script which just says "put variable" - what that does
is open the message box. I'd like to find that line of script and delete
it.

Could I really put 6000 lines of script in a variable? But you have given
me an idea. Maybe I can solve it in BBedit.

On Sat, May 4, 2013 at 4:13 PM, Robert Sneidar  wrote:

> Off the top of my head, put the script into a variable. Filter with
> "put*". Filter without "into". Not sure what you mean by orphaned.
>
> Bob Sneidar
> IT Manager
> Calvary Chapel CM
> Sent from iPhone
>
> On May 4, 2013, at 13:05, william humphrey 
> wrote:
>
> > I remember reading somewhere that version 6.0 or maybe GLX2 script editor
> > has a way to find an orphaned "put".  Anybody have any suggestions? If I
> > search for every "put" in my 6500 lines of code it will take a while and
> my
> > eyes will go blurry reading each one to check if it is putting to the
> > message box or not. Maybe there would be a way to "turn off" having a PUT
> > go right to the message box unless you say "put variable in the message
> > box"?
> > ___
> > use-livecode mailing list
> > use-livecode@lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



-- 
http://www.bluewatermaritime.com
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Finding orphaned "put"

2013-05-04 Thread Robert Sneidar
Off the top of my head, put the script into a variable. Filter with "put*". 
Filter without "into". Not sure what you mean by orphaned.

Erm... Without "*into*"

Bob Sneidar
IT Manager
Calvary Chapel CM
Sent from iPhone

On May 4, 2013, at 13:05, william humphrey  wrote:

> I remember reading somewhere that version 6.0 or maybe GLX2 script editor
> has a way to find an orphaned "put".  Anybody have any suggestions? If I
> search for every "put" in my 6500 lines of code it will take a while and my
> eyes will go blurry reading each one to check if it is putting to the
> message box or not. Maybe there would be a way to "turn off" having a PUT
> go right to the message box unless you say "put variable in the message
> box"?
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Finding orphaned "put"

2013-05-04 Thread Robert Sneidar
Off the top of my head, put the script into a variable. Filter with "put*". 
Filter without "into". Not sure what you mean by orphaned. 

Bob Sneidar
IT Manager
Calvary Chapel CM
Sent from iPhone

On May 4, 2013, at 13:05, william humphrey  wrote:

> I remember reading somewhere that version 6.0 or maybe GLX2 script editor
> has a way to find an orphaned "put".  Anybody have any suggestions? If I
> search for every "put" in my 6500 lines of code it will take a while and my
> eyes will go blurry reading each one to check if it is putting to the
> message box or not. Maybe there would be a way to "turn off" having a PUT
> go right to the message box unless you say "put variable in the message
> box"?
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode