开发者

Gambit Scheme: gsi and gsc windows closes after end!

I'm experimenting with Gambit scheme and I have problem! My OS is Windows 7. When I try to interpret script I do: gsi.exe myscript.scm

This works, but GSI's console window is shown and closed just after script finished. I can't see results my program prints! I may do (read-line) at the end, but... when I try to compile with GSC.exe the behaviour is the same: it opens console window, does something, prints about errors and closes 开发者_如何学运维it immediately - I can't read something! In this case I can't even do (read-line) hack, you see. How can I view what Gambit writes?

This doesn't works, though: gsc.exe 1.scm > 1.txt


You should run Gambit in an existing terminal window. Open up your terminal first, and then run Gambit. When Gambit terminates, your terminal will be still up.


Create a batch file with the commands. Set the properties on the batch file such that the window doesn't close after executing(right click, properties on the batch file's icon). You can always, add "pause" at the end of the bath file, to keep the window open.

Alternatively, just open a DOSBOX box, and run the script from there. The box will remain open when the scrip completes.

UPDATE

terminal

To open a terminal(Command Prompt, DOS Box,etc.) use the [Start] button. Enter cmd in the "Run" field. This will open a terminal with a command line interpreter. You can run gsc or gsi from there.

batch files

Here is the sample program hello.scm:

(display "HELLO WORLD")
(newline)

Method 1--using pause. This example is only for calling binary executable(.EXE) files such as gsc, or gsi.exe:

@echo off
gsi hello.scm
pause

Method 2--using cmd /k. The pause method (above) is preferred as this starts another cmd shell:

@echo off
cmd /k gsi hello.scm

properties

Sorry, setting the "Close on exit" property of a command apparently only exists for true DOS commands via .pif files.

To the same end right-click hello.scm, then associate it with cmd /k gsi hello.scm.

Any of the above batch files may be modified to take a filename argument (as %1, or %* for all args) and run gsc %1 instead of gsc hello.scm. After making the batch file generic in this way, associate the .SCM extension with it.

Associate .SCM with run-gsi.bat:

@echo off
gsi %*
pause
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜