This is a read-only archive of lispforum.com. The forum was locked to new users and posts and is preserved here as static HTML from a database snapshot taken on 2019-09-07.

Question about Lispworks

6 posts · 1840 views

In Lispworks, here is what I need to do:


call and run an *.EXE program from windowsxp within a running lisp program. (the easy part, I think.)

Go back to the same place I called the program from in Lisp when the EXE file has been closed or quit.

I realize that this is a pretty hard question to answer, but none the less I would appreciate it.

Thanks,

Mel
:)

Re: Question about Lispworks

I'm not a regular lispworks user; but the trivial-shell portability library contains the following code which may help.
(system:call-system-showing-output
  command
  :prefix ""
  :show-cmd nil
  :output-stream output)
and here's an example somebody posted to stackoverflow.
(sys:call-system-showing-output "ls -l" :prefix "" :show-cmd nil)
You might find more info in the LW manual. It looks like there are also call-system and run-shell-command.

Re: Question about Lispworks

It is not the running part I am after. I am really after the stopping part. And, going back where it was called from.

Re: Question about Lispworks

When the program quits, you should get an exit code. The lisp code would then continue running from where it started the other program, no?

I don't understand your question.

Re: Question about Lispworks

that is what I have been needing. An Exit code. How do I get one?

I simply want to call a windows program like a subroutine would be called in basic or c. I just need to go back where it came from after the windows program stops.

Example. I am on my robot in Lisp. I call a chat.exe program from the c: directory when I am in Lisp.
It runs the chat program in windows called from Lisp. When I am finished with the chatbot, I say Exit. A subroutine would have a "Return" at this point, but this is Lisp. No return.

Instead of just leaving me there in windows, I want it to go back from where it was called in Lisp and keep operating the robot.

does this make sense???

Thanks!!

Re: Question about Lispworks

Try call-system. Pass ":wait t" in the parameters. It will block until the program exits. The value returned will be the exit code.

Just give it a try in the REPL.