To cleaning my app i need to know if word 2 of a message which begin by "on" is s reserved word.
I tried
put ("mouseup" is reserved)
but i'm surprised that it return "false"

Thanks for your lights
Kind regard
Jean-Marc
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Code: Select all
put the script of yourScript into temp
repeat for each line tLine in temp
if word 1 of tLine = "on" then replace "on" with "command" in tLine
put tLine & return after newSCript
set the script of yourScript to newScript
Code: Select all
if word 1 of tLine = "on" and word 2 of tLine is not a reserved word then replace "on" with "command" in tLine
I put in a request for the messageNames a while back, but not many need it so I don't expect it soon.mwieder wrote: ↑Sun Dec 18, 2022 1:06 amI don't think functions are going to be a problem.
You can get a list of the built-in functions by requesting "the functionnames", but if it's possible to override one of them (if for instance one is in a backscript or other library script) then it's something you've explicitly done.
The reserved words in question here fall more under the category of "messages", and there's no way I know of to get a list of the messages that are handled by the system. I'd love to have an easy way to get that list the way we can get the commandnames or functionnames. But there isn't one that I'm aware of.
Yes, and what I was trying to get at is... why do anything with them? There are two possible cases:But being able to identify function names wasn't the root of my question here. I was asking about what to do with them once identified.
Seems we're on the same page. If custom naming conventions to distinguish custom things are good enough for Charles Simonyi they're good enough for me.
The issue wasn't how to represent the two, but rather how to identify them. The docset idea might work.Far simpler would be to distinguish with capitalization: TitleCaps for custom names (big things attract the eye), and lowerCase for generic engine stuff
Note why he wants to identify them:
I want change all of my commands and functions to private handlers.
Something like that
"private command MyHandler" instead "on MyHandler"
The reason is that I am looking for a successor to maintain my app and I think it would be clearer if he can know right away if a handler comes from livecode or if it is a personal handler.