Newbie. Pausing Program..

Hi,

I have just started pascal but have done c++ and everything so it seems like i know it all.

But, how do i pause a simple console app so it dosnt exit when executed, in c++ its done with system("PAUSE"); but i cant find how to do it in pascal.

Thanks


Comments

  • : Hi,
    :
    : I have just started pascal but have done c++ and everything so it seems like i know it all.
    :
    : But, how do i pause a simple console app so it dosnt exit when executed, in c++ its done with system("PAUSE"); but i cant find how to do it in pascal.
    :
    : Thanks
    :
    readln; (halts the run for info) even I know that much!
    before an end it doesn't need a semi colon


  • 'ReadLn' will wait for enter to be pressed while:

    Repeat until keypressed;

    will wait for any key to pressed. Don't forget to
    include CRT in your 'uses' statement (function
    KeyPressed is part of CRT unit). If you don't want
    to use CRT (many people still don't have patch for
    it) here is replacement:

    function keypressed: Boolean; assembler;
    asm
    mov ah, $11
    int 16h
    mov ax, 1
    jnz @True
    xor ax, ax
    @True:
    end;

    Iby




Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories