waifun
asked on
Using Turbo Pascal
Hello,
>I am new to Pascal programming and the Turbo Pascal compiler ver. 7.0. For
>a program I've compiled, an outline of the source code I'm using goes like this:-
>....
>BEGIN
>
> Readln (some input);
> some processing work...
> Writeln:(some output);
>END;
>
>There's no problem with my source code, just that while running the
>program, after entering the input data, pressing carriage return wouldn't
>bring about the output supposed to be displayed on screen. Instead the
>program automatically terminates and I'll have to rerun the program again
>in order to view the output produced from my previous input. What should I need to do to remedy this problem? Thanks.
>I am new to Pascal programming and the Turbo Pascal compiler ver. 7.0. For
>a program I've compiled, an outline of the source code I'm using goes like this:-
>....
>BEGIN
>
> Readln (some input);
> some processing work...
> Writeln:(some output);
>END;
>
>There's no problem with my source code, just that while running the
>program, after entering the input data, pressing carriage return wouldn't
>bring about the output supposed to be displayed on screen. Instead the
>program automatically terminates and I'll have to rerun the program again
>in order to view the output produced from my previous input. What should I need to do to remedy this problem? Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ReadKey! That is it. Too long away from Pascal. It is in CRT in 5.5 (can't say for 7.0) and Alt-F5 is the output window toggle (had to fire up TP to see).
Brings back memories. Obviously _fuzzy_ memories but memories all the same.
Good catch, Jack.
-bcl
Brings back memories. Obviously _fuzzy_ memories but memories all the same.
Good catch, Jack.
-bcl
Oh yes! That old and beloved blue screen with yellow chars!
So different from those other blue screens W95 got us used to! =)
So different from those other blue screens W95 got us used to! =)
ASKER
To bcl,
It didn't work with getch()command though I didn't get any compiler's error messages. I have also tried Alt+F5 before but it just didn't work out the way I wanted.The idea with using Readkey was good as I just don't expect the window to disappear right away after typing in the input, before the output can be seen displayed.
Thanks alot...
It didn't work with getch()command though I didn't get any compiler's error messages. I have also tried Alt+F5 before but it just didn't work out the way I wanted.The idea with using Readkey was good as I just don't expect the window to disappear right away after typing in the input, before the output can be seen displayed.
Thanks alot...
Alternative is to put a getch() command at the end of the program so the program doesn't terminate until you press another key. That way the output window retains the focus.
-bcl