Launch another app from my standalone

J. Landman Gay jacque at hyperactivesw.com
Wed Sep 2 19:33:18 EDT 2009


Adrian Williams wrote:
> Len or anyone else have an answer to this,
> 
> 'end FUNCTION' gives the error:
> 
> Handler: error in command
> Object    OK
> Line        FUNCTION getPathToFile pFile
> Hint        FUNCTION

There is a strict format you have to follow for command handlers and 
function handlers. The first line must begin with either the word "on" 
or "function". There are some other words you can use too, but to start 
with, these are the two main ones. Any block of code that starts with 
"on" is a command handler. Any block that starts with "function" is a 
function handler.

The initial word is followed by the name of the handler you are 
creating. If your handler accepts parameters, then those must follow on 
the same line too, separated by an initial space and commas between each 
parameter name, like this:

    on mycommand param1, param2, param3

Substitute the name you invent for your handler where the example above 
says "mycommand" and if you have any, substitute the name of any 
parameters in the other slots. If your handler doesn't need parameter, 
just omit those.

On subsequent lines, write the actual code statements.

At the end, you must use the word "end" followed by the handler name. 
This is the same for both command handlers and function handlers, like this:

    end mycommand

So, a command handler looks like this:

    on myHandler thisParam, thatParam, theotherParam
     -- code here
    end myHandler

And a function looks like this:

    function myFunction thing1, thing2
      -- code here
    end myFunction

Revolution is not case sensitive, so you don't need to capitalize any of 
the words. Some people have a personal style of capitalizing certain 
words to help them read their own code later. My style is to write 
mostly in lower case.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com



More information about the use-livecode mailing list