Re: List of handlers

2011-09-13 Thread Geoff Canyon Rev
Interesting -- I'd forgotten about the token keyword. It still doesn't
handle block comments though:

on mouseUp
   /*this is a
   on aCommentedCommand
  comment*/
  put token 1 to -1 of the script of me into tText
  put empty into tMenuText
  repeat for each line L in tText
 if word 1 of L is among the items of
on,function,getprop,setprop,command,private
 then put L  cr after tMenuText
  end repeat
  put tMenuText
end mouseUp

That puts

on mouseUp
   on aCommentedCommand

gc

On Sun, Sep 11, 2011 at 4:20 PM, Mark Schonewille
m.schonewi...@economy-x-talk.com wrote:
 Geoff,

 Try this:

 put token 1 to -1 of the script of tID into tText
 put empty into tMenuText
 repeat for each line L in tText
    if word 1 of L is among the items of 
 on,function,getprop,setprop,command,private
 then put L  cr after tMenuText
 end repeat

 --
 Best regards,

 Mark Schonewille

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

 Send me a friend request on Facebook if you like 
 https://www.facebook.com/marksch

 On 11 sep 2011, at 23:07, Geoff Canyon Rev wrote:

 This doesn't work with block comments, but this is what I used in 
 revNavigator:

 put the script of tID into tText
 put empty into tMenuText
 repeat for each line L in tText
     if word 1 of L is among the items of on,function,getprop,setprop
 then put L  cr after tMenuText
 end repeat


 ___
 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: List of handlers

2011-09-13 Thread Andre Garzia
On Sun, Sep 11, 2011 at 5:27 PM, zryip theSlug zryip.thes...@gmail.comwrote:

 On Sat, Sep 10, 2011 at 4:47 PM, Andre Garzia an...@andregarzia.com
 wrote:

 Hi Andre,

  Is revavailablehandlers available on a standalone? (Just curious...)

 Not sure of the usage we could have with that, but
 revavailablehandlers not working in a standalone.


Zryip,

No use at all on Standalones, it was curiosity because when it does not
function in standalones, it usually means it is implemented in the IDE
scripts but when it does, then, we discovered some hidden gems and I love
hidden commands in the engine...

Cheers and thanks
andre





 Best regards,
 --
 -Zryip TheSlug- wish you the best! 8)
 http://www.aslugontheroad.co.cc

 ___
 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.andregarzia.com All We Do Is Code.
___
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: List of handlers

2011-09-11 Thread zryip theSlug
On Sat, Sep 10, 2011 at 4:47 PM, Andre Garzia an...@andregarzia.com wrote:

Hi Andre,

 Is revavailablehandlers available on a standalone? (Just curious...)

Not sure of the usage we could have with that, but
revavailablehandlers not working in a standalone.


Best regards,
-- 
-Zryip TheSlug- wish you the best! 8)
http://www.aslugontheroad.co.cc

___
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: List of handlers

2011-09-11 Thread Geoff Canyon Rev
This doesn't work with block comments, but this is what I used in revNavigator:

put the script of tID into tText
put empty into tMenuText
repeat for each line L in tText
    if word 1 of L is among the items of on,function,getprop,setprop
then put L  cr after tMenuText
end repeat

___
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: List of handlers

2011-09-11 Thread Mark Schonewille
Geoff,

Try this:

put token 1 to -1 of the script of tID into tText
put empty into tMenuText
repeat for each line L in tText
if word 1 of L is among the items of 
on,function,getprop,setprop,command,private
then put L  cr after tMenuText
end repeat

--
Best regards,

Mark Schonewille

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

Send me a friend request on Facebook if you like 
https://www.facebook.com/marksch

On 11 sep 2011, at 23:07, Geoff Canyon Rev wrote:

 This doesn't work with block comments, but this is what I used in 
 revNavigator:
 
 put the script of tID into tText
 put empty into tMenuText
 repeat for each line L in tText
 if word 1 of L is among the items of on,function,getprop,setprop
 then put L  cr after tMenuText
 end repeat


___
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: List of handlers

2011-09-10 Thread zryip theSlug
On Sat, Sep 10, 2011 at 1:50 AM, Chip Thomas livecode.l...@gmail.com wrote:

 Hey all, is there a way to get a list of handlers within a control?

 Or see if a handler/function exists?

Hi Chip,

Try:
put the revavailablehandlers of myControl


Best regards,
--
-Zryip TheSlug- wish you the best! 8)
http://www.aslugontheroad.co.cc

___
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: List of handlers

2011-09-10 Thread Peter M. Brigham, MD
On Sep 9, 2011, at 11:56 PM, Phil Davis wrote:

 Hi Peter,
 
 Actually the 'filter' command I described will only include the 'end' 
 statements that start at char 1 of a line. Normally, only 'end handler' 
 statements would be in that category. (I'm assuming the coder used a script 
 editor like LC's which indents for readability.) But if the script code 
 outside of any handler, then your scenario could certainly happen.

Ah, right.

 Phil
 
 
 On 9/9/11 7:09 PM, Peter M. Brigham, MD wrote:
 The filter with end* will pick up end if and end repeat and end try 
 as well.
 -- first:
 replace end if with empty in tList
 replace end repeat with empty in tList
 replace end try with empty in tList
 -- then
 filter tList with end*
 replace cr  end  with cr in tList
 
 -- Peter
 
 Peter M. Brigham
 pmb...@gmail.com
 http://home.comcast.net/~pmbrig
 
 
 On Sep 9, 2011, at 8:33 PM, Phil Davis wrote:
 
 Or try this:
 
   put script ofyour control  into tList
   filter tList with end  -- EVERY handler ends this way
   replace (cr  end ) with cr in tList -- remove 'end' from each line
   sort lines of tList -- if you like
   put tList
 
 
 Phil Davis

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig


___
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: List of handlers

2011-09-10 Thread Andre Garzia
Hey Zryip,

Is revavailablehandlers available on a standalone? (Just curious...)

Cheers
andre

On Sat, Sep 10, 2011 at 6:11 AM, zryip theSlug zryip.thes...@gmail.comwrote:

 On Sat, Sep 10, 2011 at 1:50 AM, Chip Thomas livecode.l...@gmail.com
 wrote:
 
  Hey all, is there a way to get a list of handlers within a control?
 
  Or see if a handler/function exists?

 Hi Chip,

 Try:
 put the revavailablehandlers of myControl


 Best regards,
 --
 -Zryip TheSlug- wish you the best! 8)
 http://www.aslugontheroad.co.cc

 ___
 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.andregarzia.com All We Do Is Code.
___
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: List of handlers

2011-09-09 Thread Roger Eller
On Fri, Sep 9, 2011 at 7:50 PM, Chip Thomas livecode.l...@gmail.com wrote:

 Hey all, is there a way to get a list of handlers within a control?

 Or see if a handler/function exists?

 Thanks!


put the script of your object here into tHandList
filter tHandList with *on  space  * -- just for readability... could
also be *on *
answer tHandList

put the script of your object here into tFuncList
filter tFuncList with *function  space  * -- just for readability...
could also be *function *
answer tFuncList

˜Roger
___
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: List of handlers

2011-09-09 Thread Phil Davis

Or try this:

   put script of your control into tList
   filter tList with end  -- EVERY handler ends this way
   replace (cr  end ) with cr in tList -- remove 'end' from each line
   sort lines of tList -- if you like
   put tList


Phil Davis


On 9/9/11 5:05 PM, Roger Eller wrote:

On Fri, Sep 9, 2011 at 7:50 PM, Chip Thomaslivecode.l...@gmail.com  wrote:


Hey all, is there a way to get a list of handlers within a control?

Or see if a handler/function exists?

Thanks!


put the script ofyour object here  into tHandList
filter tHandList with *on  space  * -- just for readability... could
also be *on *
answer tHandList

put the script ofyour object here  into tFuncList
filter tFuncList with *function  space  * -- just for readability...
could also be *function *
answer tFuncList

˜Roger
___
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



--
Phil Davis

PDS Labs
Professional Software Development
http://pdslabs.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: List of handlers - snake

2011-09-09 Thread Joe Lewis Wilkins
Hi everyone,

While you're on this exploration topic, in HyperCard we had a routine with the 
word snake in it as I recall. It could be used from the message box and it 
would take you through all of the open stacks, including the stacks in use, and 
the objects within the stacks, one by one, opening any script that contained 
the word or phrase for which you started searching. You could edit the newly 
opened script, close it, and the search would continue until ever instance of 
the word or phrase had been exposed. 

I've not noticed a similar routine in LC. It was my favorite debugging tool. I 
believe it could also be called from within a script. It was absolutely super. 
It may have been an XCMD.

It would be wonderful if we had such a critter in LC.
 
Joe Lewis Wilkins
Architect

On Sep 9, 2011, at 5:05 PM, Roger Eller wrote:

 On Fri, Sep 9, 2011 at 7:50 PM, Chip Thomas livecode.l...@gmail.com wrote:
 
 Hey all, is there a way to get a list of handlers within a control?
 
 Or see if a handler/function exists?
 
 Thanks!
 
 
 put the script of your object here into tHandList
 filter tHandList with *on  space  * -- just for readability... could
 also be *on *
 answer tHandList
 
 put the script of your object here into tFuncList
 filter tFuncList with *function  space  * -- just for readability...
 could also be *function *
 answer tFuncList
 
 ˜Roger


___
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: List of handlers

2011-09-09 Thread Peter M. Brigham, MD
The filter with end* will pick up end if and end repeat and end try as 
well.
-- first:
replace end if with empty in tList
replace end repeat with empty in tList
replace end try with empty in tList
-- then
filter tList with end*
replace cr  end  with cr in tList

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig


On Sep 9, 2011, at 8:33 PM, Phil Davis wrote:

 Or try this:
 
   put script of your control into tList
   filter tList with end  -- EVERY handler ends this way
   replace (cr  end ) with cr in tList -- remove 'end' from each line
   sort lines of tList -- if you like
   put tList
 
 
 Phil Davis
 
 
 On 9/9/11 5:05 PM, Roger Eller wrote:
 On Fri, Sep 9, 2011 at 7:50 PM, Chip Thomaslivecode.l...@gmail.com  wrote:
 
 Hey all, is there a way to get a list of handlers within a control?
 
 Or see if a handler/function exists?
 
 Thanks!
 
 put the script ofyour object here  into tHandList
 filter tHandList with *on  space  * -- just for readability... could
 also be *on *
 answer tHandList
 
 put the script ofyour object here  into tFuncList
 filter tFuncList with *function  space  * -- just for readability...
 could also be *function *
 answer tFuncList
 
 ˜Roger
 ___
 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
 
 
 -- 
 Phil Davis
 
 PDS Labs
 Professional Software Development
 http://pdslabs.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


___
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: List of handlers

2011-09-09 Thread Peter M. Brigham, MD
On Sep 9, 2011, at 8:33 PM, I wrote:

 The filter with end* will pick up end if and end repeat and end try 
 as well.
 -- first:
 replace end if with empty in tList
 replace end repeat with empty in tList
 replace end try with empty in tList
 -- then
 filter tList with end*
 replace cr  end  with cr in tList

I forgot: you have to append a cr to the beginning of tList first:

filter tList with end*
replace cr  end  with cr in (cr tList)
-- will catch first line
delete char 1 of tList -- it's a cr

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig


___
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: List of handlers

2011-09-09 Thread Phil Davis

Hi Peter,

Actually the 'filter' command I described will only include the 'end' statements 
that start at char 1 of a line. Normally, only 'end handler' statements would 
be in that category. (I'm assuming the coder used a script editor like LC's 
which indents for readability.) But if the script code outside of any handler, 
then your scenario could certainly happen.


Phil


On 9/9/11 7:09 PM, Peter M. Brigham, MD wrote:

The filter with end* will pick up end if and end repeat and end try as 
well.
-- first:
replace end if with empty in tList
replace end repeat with empty in tList
replace end try with empty in tList
-- then
filter tList with end*
replace cr  end  with cr in tList

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig


On Sep 9, 2011, at 8:33 PM, Phil Davis wrote:


Or try this:

   put script ofyour control  into tList
   filter tList with end  -- EVERY handler ends this way
   replace (cr  end ) with cr in tList -- remove 'end' from each line
   sort lines of tList -- if you like
   put tList


Phil Davis


On 9/9/11 5:05 PM, Roger Eller wrote:

On Fri, Sep 9, 2011 at 7:50 PM, Chip Thomaslivecode.l...@gmail.com   wrote:


Hey all, is there a way to get a list of handlers within a control?

Or see if a handler/function exists?

Thanks!

put the script ofyour object here   into tHandList
filter tHandList with *on   space   * -- just for readability... could
also be *on *
answer tHandList

put the script ofyour object here   into tFuncList
filter tFuncList with *function   space   * -- just for readability...
could also be *function *
answer tFuncList

˜Roger
___
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


--
Phil Davis

PDS Labs
Professional Software Development
http://pdslabs.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


___
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



--
Phil Davis

PDS Labs
Professional Software Development
http://pdslabs.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: List of handlers

2011-09-09 Thread Phil Davis

On 9/9/11 7:14 PM, Peter M. Brigham, MD wrote:

On Sep 9, 2011, at 8:33 PM, I wrote:


The filter with end* will pick up end if and end repeat and end try as 
well.
-- first:
replace end if with empty in tList
replace end repeat with empty in tList
replace end try with empty in tList
-- then
filter tList with end*
replace cr  end  with cr in tList

I forgot: you have to append a cr to the beginning of tList first:


I forgot about that one in my original post also.
Phil


filter tList with end*
replace cr  end  with cr in (crtList)
-- will catch first line
delete char 1 of tList -- it's a cr

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig


___
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



--
Phil Davis

PDS Labs
Professional Software Development
http://pdslabs.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