Re: Running one program from another
- Posted by DonCole Feb 22, 2014
- 1728 views
jimcbrown said...
eukat said...
ghaberek said...
This is what I use...
-- start.e include std/cmdline.e include std/filesys.e include std/search.e include std/sequence.e include std/text.e include std/types.e public function search_path( sequence file_name ) -- search the PATH environment variable for a file sequence PATH = getenv( "PATH" ) if atom( PATH ) then PATH = current_dir() end if sequence paths = split( PATH, PATHSEP, 1 ) for i = 1 to length( paths ) do sequence path = paths[i] if not search:ends( SLASH, path ) then path &= SLASH end if path &= file_name if file_exists( path ) then return path end if end for return "" end function <snip>
You could just use dir(file_name). No dir = it does not exist.
In place of the call to file_exists() ? Agreed. In fact, at least in some cases, file_exists() is implemented using this very method.
Thank you, jimbrown, eukat, and ghaberek,
This all well and good. But like I said I am using Al Getz's Launch Pad 403 (I know where it is on my computer).
What I want to know is how do I shut down LP403.exw or LP403.exe with out shutting down the program I am launching?
Thank you,
Don Cole