Launch another app from my standalone

Jim Bufalini jim at visitrieve.com
Sun Aug 30 06:59:25 EDT 2009


Dear Adrian,

> Jim,
> The docs give the "it" example - so I used it verbatim.

In general, my stock advise is don't use "it" unless you are absolutely sure
that "it" has just been set (as in right after a get). There are too many
handlers that set "it." When you get to using sends and communications, it's
a tossup as to what is actually in "it."

> There are not two launch statements.

Your snippet had:

> launch "MyProgram.exe"

> launch it

I see the word launch twice. Maybe I'm getting old and double vision? ;-)


> The 'get shell' is a script in another button I was trying too. But I
> got the same error.
> Guess this is all to do with the defaultFolder.
> The reason I wanted to use "it" was that I have no way to know the
> actual pathname.

YOU don't know the pathname? RunRev is a programming language, not a
psychic.

> Whilst there are ways to get this, I wanted to keep it real simple,
> because after all, everything is in the same folder.

Same folder? Which folder? When running in the IDE, the defaultFolder is
going to be where you launched Revolution.exe from. After you build a
standalone, it will be where your EXE launches from. Better to be explicit.
Simplicity is actually taking the time to not waste time.

> 
> Is it necessary to 'put' and 'set' the defaultFolder if the full
> pathname is not used?

The put and set from/to tOrigDefaultFolder, in my example, in not necessary.
It's just good practice. Setting the defaultFolder is persistent, which
unlike some other sets revert at the end of a handler. So, setting the
itemDelimiter will revert after a handler finishes, but the defaultFolder
won't. 

Sometime in the future, it's a good bet that you will write a handler that
"assumes" the default directory. If you have changed it because of some
external program you needed to call today, which you will no doubt forget
you did 4-weeks from now, you will be posting to this list again, then
asking why something else "doesn't work." ;-) 

Again, simplicity is actually taking the time to not waste time.

Aloha from Hawaii

Jim Bufalini 






More information about the use-livecode mailing list