Using ReadKey in Pascal

preview_player
Показать описание
This Video demonstrates the difference between readkey and readln.

Here's the code:

program readkeydemo;
uses crt;
var
confirm:string;

begin

writeln('Would you like to continue? y=yes, any other key=no');

//readLn(confirm);
confirm:=readkey();
If confirm='y' then
writeln('you have chosen to continue')
else
writeln('You have chosen to quit');

readln();

end.
Рекомендации по теме
Комментарии
Автор

Really well made video! Best IT Teacher 2017

kristanbirbalsingh
Автор

i think the parenthesis after readkey are unnecessary. And perhaps it's better to use the char variable type

dioniko_
join shbcf.ru