How to create a List of My Functions and My Commands

Kay C Lan lan.kc.macmail at gmail.com
Sat Sep 27 23:34:08 EDT 2014


I know how to get a list of LCs inbuilt function and commands but is
there a quick way to get all my own handler names that are contained
within an entire stack?

I can get customProperties["mySet"], but I can't find customFunctions
or customCommands.

At this stage it looks like I have to step through each object,
extract each script and then parse out the handler names; which of
course is exactly what LC does extremely quickly and efficiently, but
not as quick as if there is a command/function that already does it
;-)

As an aside, as part of my fiddling around with this I've posted the
following bug report for the Dictionary entry for 'functionNames'

Bug 13547

The example code for the Dictionary entry functionNames is erroneous
and confusing for several reasons:

Actual entry:

if myHandlerName is in the functions then answer "Choose another name."

'the functions' is wrong, it should be 'the functionNames'

Unfortunately if you just change the example to:

if myHandlerName is in the functionNames then answer "Choose another name."

it is not clear if myHandlerName is a variable or the actual name. If
it is the actual name this apparently works correctly as the answer
dialog does not pop up, but if you change it to:

if avgDev is in the functionNamess then answer "choose another name."

you will get a compilation error, basically because any
function/command name should be quoted if you don't want it
interpreted as an actual function/command.

So a correct and more useful example would be:

if "avgDev" is in the functionNames then answer "Choose another name."

repeat for each item nameToTest in listOfName
  if nameToTest is in the functionNames then
      answer "Function " & nameToTest & " is reserved by LC."
  end if
end repeat




More information about the use-livecode mailing list