我想在记事本++中编写、构建和执行一个Pascal程序。如果我在cmd中执行程序,输出是正常的,但是在nppexec的控制台中,输出是空的。
我的守则:
Program Edgar;
Uses Crt;
Var cnt, tip, pot : INTEGER;
Begin
TextColor(Red);
WriteLn('Hallo');
tip := -1;
cnt := 0;
Randomize;
pot := Random(2501)*10;
WriteLn(pot);
WHILE (tip <> pot) do
Begin
WriteLn('Tip: ');
ReadLn(tip);
if (tip < pot) then begin
WriteLn('Too low');
cnt := cnt + 1
end;
if (tip > pot) then begin
WriteLn('Too High');
cnt := cnt + 1
end;
end;
cnt:= cnt + 1;
WriteLn('IA IA');
WriteLn('Tries: ',cnt );
End.构建命令:
cd $(CURRENT_DIRECTORY)
fpc $(NAME_PART).pas
$(NAME_PART).exe产出(Nppexec):
Free Pascal Compiler version 2.6.2 [2013/02/12]
for i386 Copyright (c) 1993-2012 by Florian Klaempfl
and others Target OS: Win32 for i386
Compiling ue23.pas
Linking ue23.exe 27 lines compiled, 0.1 sec , 33536 bytes code, 1900 bytes data
<<< Process finished.
(Exit code 0)
ue23.exe Process started >>>发布于 2013-10-21 08:00:19
如果启用单元CRT,应用程序将直接写入控制台(使用*console winapi函数),而不是使用stdout。
npp的控制台屏幕可能不是真正的控制台屏幕,而是标准输出(-piped)的捕获。
除了不使用crt (因此不使用光标移动和着色)之外,没有什么可以做的,这可能是NPP的一个限制。
发布于 2014-04-14 08:27:09
之后,当光标在输出端闪烁时,您需要按下"Enter“键。
最后得到这些行的输出。
<<< Process finished. (Exit code 0)
================ READY ================没有限制,您可以从notepad++的输出端运行命令。
https://stackoverflow.com/questions/19488807
复制相似问题