Interesting commands, functions and properties

Are you developing tools to extend the LiveCode environment? This is the place to talk about the nuts and bolts of extending our nuts and bolts. If you want to use a LiveCode or third party Environment extension, visit the Using Evironment Extensions forum.

Moderators: heatherlaine, Klaus, FourthWorld, robinmiller, kevinmiller

Post Reply
shaosean
Posts: 905
Joined: Thu Nov 04, 2010 7:53 am

Interesting commands, functions and properties

Post by shaosean » Fri Mar 29, 2013 6:26 am

While I was snooping through the script editor scripts, I came across an interesting property - revAvailableHandlers.. The syntax is:

Code: Select all

put the revAvailableHandlers of <object>
The output is a return-delimited list in the following format:

Code: Select all

M mouseUp 1 4 button id 1013 of card id 1002 of stack "/Users/shaosean/Documents/Programming RR/rnd/custom control events/ssCustomControlEvents.rev"
M oink 19 21
PM squeal 6 8
PF moo 10 12
F rawr 15 17
G moo 27 29
S moo 23 25
The first word is one of the following:
M - public message/command
F - public function
PM - private message/command
PF - private function
G - getProp
S - setProp

The second word is the name of the handler.
The third word is the line number the handler starts on
The fourth word is the line number the handler ends on

The first line in the output also has the long id of the control (word 5 to -1)

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2673
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: Interesting commands, functions and properties

Post by mwieder » Wed Apr 03, 2013 12:23 am

The most interesting thing, of course, is that it works on protected stacks as well.

shaosean
Posts: 905
Joined: Thu Nov 04, 2010 7:53 am

Re: Interesting commands, functions and properties

Post by shaosean » Wed Apr 03, 2013 6:30 am

Better start renaming some of my handlers then ;-)

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2172
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: Interesting commands, functions and properties

Post by jmburnod » Thu May 02, 2013 10:42 am

Hi shaosean,
Thanks for share this. Very useful for me in this moment

CoffeeCone
Posts: 64
Joined: Fri Apr 26, 2013 8:38 am

Re: Interesting commands, functions and properties

Post by CoffeeCone » Thu May 02, 2013 11:01 am

Oh wow, I was looking for something this the other day but forgot to ask about it here. It's perfect!
Learning LiveCode, one step at a time.

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

Re: Interesting commands, functions and properties

Post by andrewferguson » Sat Aug 03, 2013 4:32 pm

I have found another interesting one!

Code: Select all

revDebuggerValidGlobalNames()
It returns all the global variables that can be used in a script, because some do not work. Like $programFiles(x86), if you are on a Windows 64 bit system with LiveCode installed in C:\Program Files (x86)\

Andrew

Post Reply

Return to “Extending LiveCode”