Launch another app from my standalone

Len Morgan len-morgan at crcom.net
Sat Sep 5 08:34:10 EDT 2009


Adrian,

I don't think the problem was that the function was defined after the 
mouseUp handler, it's that it was defined IN the mouseUp handler.  You 
cannot define a function (or command) within the "on....end" of another 
handler.

len

Adrian Williams wrote:
> Phil,
>
> Thanks for spotting that a FUNCTION needs to be stated before mouseUp.
> I knew that of course but overlooked it. Something that happens with 
> irregular use of Rev.
> Thanks too to everyone who responded to resolve my problems. In the 
> process I learned a lot.
> At least one thing I learned; I must learn more about Rev!
>
> Adrian
>
> On 3 Sep 2009, at 09:09, Phil Jimmieson wrote:
>
>> Hi Adrian,
>> if the script in your email is exactly what you are using, then you 
>> need to move the function declaration outside of the mouseup handler. 
>> I don't think that these things can be nested.
>>
>> - - -
>> FUNCTION getPathToFile pFile
>>    put the filename of this stack into the theFile
>>    set the itemdelimiter to slash
>>    put pFile into the last item of theFile
>>    return theFile
>> end getPathToFile
>>
>>
>> on mouseUp
>>   start using stack "My App"
>>
>>   put "MyPrettyFont.ttf" into myList
>>   removeFonts myList
>>   put the result into rslt
>>   if rslt is not empty then
>>        answer information rslt
>>   end if
>>
>>   --To use:
>>   put getPathFile("My App.exe") into tFile
>>   launch tFile
>>
>>   stop using stack "My App"  --(Ooops. Corrected literal 'May' here 
>> in my last message, this is not the problem)
>> end mouseUp
>> - - -
>>
>> On 3 Sep 2009, at 07:42, Adrian Williams wrote:
>>
>>> Phil,
>>>
>>> Mouse up calls stack script to remove installed font and return
>>> result. That already works.
>>> When adding the FUNCTION code, the FUNCTION line keeps throwing up the
>>> error.
>>> I've followed all the advice everyone has given - I'm stumped.
>>> - - -
>>> on mouseUp
>>> start using stack "My App"
>>>
>>>   put "MyPrettyFont.ttf" into myList
>>>   removeFonts myList
>>>   put the result into rslt
>>>   if rslt is not empty then
>>>        answer information rslt
>>>   end if
>>>
>>> FUNCTION getPathToFile pFile
>>> put the filename of this stack into the theFile
>>> set the itemdelimiter to slash
>>> put pFile into the last item of theFile
>>> return theFile
>>> end getPathToFile
>>>
>>> --To use:
>>> put getPathFile("My App.exe") into tFile
>>> launch tFile
>>>
>>> stop using stack "My App"  --(Ooops. Corrected literal 'May' here in
>>> my last message, this is not the problem)
>>> end mouseUp
>>> - - -
>>> Does that help?
>>> Adrian
>>>
>>>
>>> On 2 Sep 2009, at 18:26, Phil Davis wrote:
>>>
>>>> So... maybe we should start at the beginning. The object in which
>>>> the error occurred is apparently named "OK". What does the code of
>>>> that object look like?
>>>>
>>>> Phil Davis
>>>>
>>>>
>>>>
>>>> Adrian Williams wrote:
>>>>> Phil,
>>>>> Already tried just 'end' - it gets the same error!
>>>>> Adrian
>>>>>
>>>>> On 2 Sep 2009, at 17:13, Phil Jimmieson wrote:
>>>>>
>>>>>> Hi Adrian,
>>>>>> at the end of the function definition, you only put "end" and the
>>>>>> name of the function - you don't include the parameter list.
>>>>>>
>>>>>> On 2 Sep 2009, at 17:10, 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
>>>>>>>
>>>>>>> On 30 Aug 2009, at 17:24, Len Morgan wrote:
>>>>>>>> I"m hoping Trevor won't mind me sharing this little snippet of
>>>>>>>> code:
>>>>>>>>
>>>>>>>> FUNCTION getPathToFile pFile
>>>>>>>> put the filename of this stack into the theFile
>>>>>>>> set the itemdelimiter to slash
>>>>>>>> put pFile into the last item of theFile
>>>>>>>> return theFile
>>>>>>>> end FUNCTION getPathToFile
>>>>>>>>
>>>>>>>> --To use:
>>>>>>>> put getPathFile("My App.exe") into tFile
>>>>>>>> launch tFile
>>>>>>>>
>>>>>>>> That should do it.
>>>>>>>>
>>>>>>>> len morgan
>>>>>>>
>>>>>>> Ideas?
>>>>>>> Thanks,
>>>>>>> Adrian
>>>>
>>>> -- 
>>>> Phil Davis
>>>>
>>>> PDS Labs
>>>> Professional Software Development
>>>> http://pdslabs.net
>>>>
>>>> _______________________________________________
>>>> use-revolution mailing list
>>>> use-revolution at lists.runrev.com
>>>> Please visit this url to subscribe, unsubscribe and manage your
>>>> subscription preferences:
>>>> http://lists.runrev.com/mailman/listinfo/use-revolution
>>>
>>> _______________________________________________
>>> use-revolution mailing list
>>> use-revolution at lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your 
>>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-revolution
>>
>> -- 
>> Phil Jimmieson  phil at liverpool.ac.uk  (UK) 0151 795 4236  (Mobile) 
>> 07976 983164
>> Computer Science Dept., Liverpool University, Ashton Building, Ashton 
>> Street
>> Liverpool L69 3BX              http://www.csc.liv.ac.uk/~phil/
>> I used to sit on a special medical board... ...but now I use this 
>> ointment.
>>
>>
>>
>>
>> _______________________________________________
>> use-revolution mailing list
>> use-revolution at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your 
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-revolution
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your 
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
>



More information about the Use-livecode mailing list