Here's what I've done so far in J (version 6, since windows work
within J wants stability):
   require 'tasks'  NB. fails
   require 'task'
   open 'task'
   open '~system/main/dll.ijs'

Looking at the implementation of task.ijs I see

Wait=: 3 : 0
r=. WaitForSingleObject y
if. WAIT_TIMEOUT=r do. TerminateProcess (0 pick y);_1 end.
)

(I am not listing these in the order I found them or recognized them
because I had to make several passes over the material before I really
started recognizing what I was seeing.)

WaitForSingleObject=: 'WaitForSingleObject > i x i' cdk

See http://www.jsoftware.com/user/call_procedure.htm for what that > i
x i text means.

WaitForSingleObject is currently documented at
http://msdn.microsoft.com/en-us/library/windows/desktop/ms687032(v=vs.85).aspx
(historically, msdn has not gone with the "cool url" concept - instead
these links expire after a time forcing traffic to search engines like
google and pruning their casual developer community -- so if that url
works for you, that is great but I would not assume that it will
always be valid). WaitForSingleObject does not give a "return code"
for the process.

However, the documentation on CloseObject (currently visible at
http://msdn.microsoft.com/en-us/library/windows/desktop/ms724211(v=vs.85).aspx)
says that you can call GetLastError to get error information. But that
might not be what you want (since it's information on a thread rather
than a process and since the call can fail if you do not have adequate
permissions).

It might just be that you want the return code from CloseHandle?

Or maybe you are thinking about the exit code which is feature of cmd
and power shell?

Thanks,

-- 
Raul


On Thu, Dec 26, 2013 at 10:41 AM, Philip A. Viton <[email protected]> wrote:
>
> Is there any way, using the verbs in the tasks package under MS Windows, to
> access the return code of a process, if it sets one? If not, is there some
> way to get these, possibly without the tasks package?
>
> Thanks!
>
>
>
> ------------------------
> Philip A. Viton
> City Planning, Ohio State University
> 275 West Woodruff Avenue, Columbus OH 43210
> [email protected]
>
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to