Launch another app from my standalone

Len Morgan len-morgan at crcom.net
Sun Aug 30 14:51:15 EDT 2009


Adrian,

<SOAPBOX state='mount'>
Before we go any further, if you're going to get MEANINGFUL help from 
this forum, you've got to be much more specific when you ask a question 
or show a code segment.  For example:
> -- function
> getPathToFile pFile
>   put the filename of this stack into theFile  --removed unwanted 
> 'the' from your original
>   set the itemdelimiter to slash
>   put pFile into the last item of theFile
>   return theFile
> getPathToFile
> --end function
>
is NOT a function definition!  You've written it as if it was going to 
be executed as inline code.  The fact that it might actually do it 
doesn't matter (in fact, this should throw an error because the 
"getPathToFile" is never DEFINED as a function.  Why would you not write 
the above the way I did, i.e.,

FUNCTION getPathToFile pFile
....
end FUNCTION

???  It uses fewer characters and is the syntacticly correct way to 
write rev code.  The way you have written it, it appears you call 
getPathToFile with an argument of pFile, then execute 4 statements, then 
call getPathToFile AGAIN with no arguments.  The '--function' and '--end 
function' are shown as comments.  It's only because I wrote the original 
code (well, actually copied the code from something Trevor wrote) that I 
know you're trying to define a function.  Many other people that might 
have far better answers than mine (Trevor's) might just skip your 
message because it makes no sense.

</SOAPBOX>

Since there is a space in the filename, it interprets what you pass as 
TWO arguments when  you've defined (hopefully) only a single argument.  
If you are going to "hardcode" the filename as you've shown below...
> --Use the function
> put getPathFile(My App.exe) into tFile
> launch tFile
>
... then you have to put the filename in quotes so that it will be 
interpreted as a single argument.  You call to the function should be:

put getPathToFile("My App.exe") into tFile

or I believe if you wanted a more generic solution:

put "My Multiword App Name.exe" into tFilename
put getPathToFile(tFilename)

would work.

Sorry if it seemed like I was going off on you (I'm having a little 
difficulty with my 13 year old daughter doing what she is told and 
you're getting the heat for it :-( ) but I think you will find a lot 
more help here if you tell/show EXACTLY what you are doing that isn't 
working instead of trying to simplify things for us.  It only makes the 
problem worse.  You don't need to include ALL of your code, only the 
parts that aren't working or are relevant to that code.

len



More information about the use-livecode mailing list