尝试通过 Notepad++ 编译 pascal 程序时失败? [英] Failure when trying to compile pascal programs via Notepad++?
问题描述
我正在尝试在 Free Pascal Compiler 上使用 Notepad++ 编译 pascal 文件.我已被指示使用以下脚本:
I'm trying to complile pascal files with Notepad++ on Free Pascal Compiler. I've been instructed to use the following script:
NPP_SAVE
cd $(CURRENT_DIRECTORY)
C:\FPC\2.6.4\bin\i386-win32\ppcrossx64.exe $(NAME_PART).pas
但是当我尝试运行该程序时,Notepad++ 控制台给了我以下消息:
But when I try to run the program, Notepad++ console gives me the following message:
NPP_SAVE: C:\FPC\2.6.4\bin\i386-win32\new 1.pas
CD: C:\FPC\2.6.4\bin\i386-win32
Current directory: C:\FPC\2.6.4\bin\i386-win32
C:\FPC\2.6.4\bin\i386-win32\ppcrossx64.exe new 1.pas
Process started >>>
Fatal: Can't open file "1.pas"
Fatal: Compilation aborted
<<< Process finished. (Exit code 1)
================ READY ================
我也尝试使用:
C:\FPC\2.6.4\bin\i386-win32\ppcrossx64.exe "$(FULL_CURRENT_PATH)"
但它给了我:
C:\FPC\2.6.4\bin\i386-win32\ppcrossx64.exe "C:\FPC\2.6.4\bin\i386-win32\new 1.pas"
Process started >>>
<<< Process finished. (Exit code 0)
================ READY ================
即使我有:readln();
在程序中.
Even if I have: readln();
in the program.
推荐答案
您的第二个命令(带引号)似乎编译成功.它报告退出代码 0.您可以尝试故意包含一个语法错误,看看编译器是否以及如何报告它.
Your second command (with the quotes) seems to compile successfully. It reports the exit code 0. You can try to deliberately include a syntax error and see if and how the compiler reports it.
我认为您现在缺少的是一种在编译成功后运行程序的方法.您可以使用以下内容创建第二个脚本:
I think what you are missing now is a way to run the program after the compile is successfull. You can create a second script with something like this:
cd "$(CURRENT_DIRECTORY)"
"$(NAME_PART).exe"
将第一个编译脚本绑定到一个键盘快捷键,将第二个运行脚本绑定到另一个键盘快捷键,只有在编译正常时才运行.
Bind the first compile script to a keyboard shortcut, bind the second run script to a different keyboard shortcut, only run when the compile is ok.
这篇关于尝试通过 Notepad++ 编译 pascal 程序时失败?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!