策略:gsi和gsc窗口结束后关闭!
我正在尝试 Gambit 方案,但遇到了问题!我的操作系统是 Windows 7。 当我尝试解释脚本时,我会这样做: gsi.exe myscript.scm
这可以工作,但 GSI 的控制台窗口会在脚本完成后立即显示并关闭。我看不到我的程序打印的结果!我可能会在最后执行(读取行),但是...当我尝试使用 GSC.exe 进行编译时,行为是相同的:它打开控制台窗口,执行某些操作,打印有关错误的信息并立即关闭它 - 我可以'不要读东西!在这种情况下,我什至无法进行(读取行)黑客攻击,你看。我如何查看 Gambit 所写的内容?
但这不起作用: gsc.exe 1.scm > 1.txt
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您应该在现有的终端窗口中运行 Gambit。首先打开终端,然后运行 Gambit。当 Gambit 终止时,您的终端仍将处于运行状态。
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.
使用命令创建批处理文件。
设置批处理文件的属性,使窗口在执行后不会关闭(右键单击,批处理文件图标上的属性)。
您始终可以在 Bath 文件末尾添加“暂停”,以保持窗口打开。
或者,只需打开 DOSBOX 框,然后从那里运行脚本。票据完成后,该盒子将保持打开状态。
更新
终端
要打开终端(命令提示符、DOS 框等),请使用[开始]按钮。在“运行”字段中输入
cmd
。这将打开一个带有命令行解释器的终端。您可以从那里运行 gsc 或 gsi。
批处理文件
下面是示例程序 hello.scm:
方法 1 - 使用暂停。此示例仅用于调用二进制可执行文件 (.EXE),例如 gsc 或 gsi.exe:
方法 2 - 使用
cmd /k
。 暂停方法(上面)是首选,因为这会启动另一个 cmd shell:属性
抱歉,设置命令的“退出时关闭”属性显然仅适用于真正的 DOS 命令通过 .pif 文件。
同样,右键单击 hello.scm,然后将其与
cmd /k gsi hello.scm
关联。上述任何批处理文件都可以修改为采用文件名参数(如 %1 或所有参数的 %*)并运行
gsc %1
而不是 gsc hello.scm。以这种方式使批处理文件通用后,将.SCM 扩展名与其关联。将 .SCM 与 run-gsi.bat 关联:
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:
Method 1--using pause. This example is only for calling binary executable(.EXE) files such as gsc, or gsi.exe:
Method 2--using
cmd /k
. The pause method (above) is preferred as this starts another cmd shell: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: