2013-10-21 5 views
2

메모장 + +에서 파스칼 프로그램을 작성하고 실행하려고합니다. 난 출력이 정상에 cmd 프로그램을 실행하지만, nppexec 출력에서 ​​콘솔에 비어있는 경우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 >>> 

답변

3

단위 CRT를 사용하면 응용 프로그램이 직접 콘솔에 기록합니다 (* conso 르 winapi 함수)를 사용하는 대신 stdout.

아마 npp의 콘솔 화면은 실제 콘솔 화면이 아니지만 stdout (-piped) 캡처 만 가능합니다.

crt를 사용하지 않고 (따라서 커서 이동 및 채색을 사용하지 않음) 수행 할 수있는 일은 많지 않습니다. 이는 NPP 제한 일 수 있습니다.

-1

그런 다음 커서가 출력면에서 깜박일 때 "Enter"키를 눌러야합니다.

그리고 마지막 줄에는 출력이 표시됩니다.

제한이 없으며 notepad ++의 출력 쪽에서 명령을 실행할 수 있습니다.

관련 문제