1. Win32Lib & system_exec : how can it run NotePad or WordPad?
Ok,
Can anyone tell me how to make WordPad execute from within a Win32Lib
program??
I got system_exec to RUN Euphoria programs from within a Win32Lib program,
but I can't get it to run WordPad to SHOW a file. Bearing in mind what
works in David Cuny's IDE "run project" section, I tried something that
looked essentially similar:
result = system_exec("C:\\Program Files\\Accessories\\WORDPAD.EXE \"" &
fName & "\"",2)
but it doesn't evoke WordPad. It does return a -1, which means it can't run
the program, but I don't know what to make of that. (Haven't any but the
foggiest idea why it needed double back-slashes, but it wouldn't run without
them. I think they are special symbols that need to be doubled to be taken
literally instead of as a special control symbol.)
Dan
2. Re: Win32Lib & system_exec : how can it run NotePad or WordPad?
Hah!
Took a stab in the dark & it worked:
Apparently long file/directory names don't work with system_exec, but
result = system_exec("C:\\Progra~1\\Access~1\\WORDPAD.EXE \"" & fName &
"\"",2)
did work.
Yay!
Dan
----- Original Message -----
From: "Dan B Moyer" <DANMOYER at prodigy.net>
To: "Euphoria Mail List" <EUPHORIA at LISTSERV.MUOHIO.EDU>
Sent: Thursday, August 31, 2000 4:41 AM
Subject: Win32Lib & system_exec : how can it run NotePad or WordPad?
> Ok,
>
> Can anyone tell me how to make WordPad execute from within a Win32Lib
> program??
>
> I got system_exec to RUN Euphoria programs from within a Win32Lib program,
> but I can't get it to run WordPad to SHOW a file. Bearing in mind what
> works in David Cuny's IDE "run project" section, I tried something that
> looked essentially similar:
>
> result = system_exec("C:\\Program Files\\Accessories\\WORDPAD.EXE \"" &
> fName & "\"",2)
>
> but it doesn't evoke WordPad. It does return a -1, which means it can't
run
> the program, but I don't know what to make of that. (Haven't any but the
> foggiest idea why it needed double back-slashes, but it wouldn't run
without
> them. I think they are special symbols that need to be doubled to be
taken
> literally instead of as a special control symbol.)
>
> Dan
>
>
>
3. Re: Win32Lib & system_exec : how can it run NotePad or WordPad?
If you're using win32lib, why use system_exec() at all,
...when you could be using shellExecute() ?
Anyways, system_exec() will handle long file/path names, *if* you are using
exw.exe, and "quote" the file/path name properly.
Example-- that opens itself :
--show_it.exw--
atom result
sequence thefullPath -- in quotes
thefullPath
= "\"C:\\Program Files\\Accessories\\Wordpad.exe show_it.exw\""
result
= system_exec(thefullPath,2)
--end--
Notepad doesn't even need a path, as shown here:
--show_it2.exw--
atom result
sequence theprogram
theprogram
= "notepad.exe show_it2.exw"
result
= system_exec(theprogram,2)
--end--
Wolf