Program after press any key write char and ASCII code
Delphi & Pascal (česká wiki)
Category: KMP (Club of young programmers)
Author: Andrew DiE
Program: Code2.pas
File exe: Code2.exe
Author: Andrew DiE
Program: Code2.pas
File exe: Code2.exe
Program after press any key write char and ASCII code.
{ CODE2.PAS } { Program po stlaceni lubovolneho klavesu napise jeho kodovu } { hodnotu v tabulke ASCII. } { } { Author: Andrew DiE } { Datum: 18.08.2005 http://www.trsek.com } program ASCII_code; uses crt; var Z,X:char; procedure default; begin textbackground(Black);textcolor(White); end; procedure HELP_roh; begin gotoxy(74,1); textbackground(LightGray); textcolor(Red);write('F1'); textcolor(Black);writeln(' Help'); end; Begin clrscr; textcolor(White); write('Program sa spusta'); delay(500); write('.'); delay(400); write('.'); delay(400); write('.'); delay(400); writeln(' OK'); HELP_roh;default; repeat Z:=readkey; X:=z; textcolor(LightBlue); write('"',Z,'"'); textcolor(White); write('=>'); textcolor(LightRed); write(ord(Z),' '); if X=#0 then if readkey=#59 then begin clrscr; textcolor(white); writeln('HELP : Program napise kod znaku na kl vesnici, program ukoncˇs stlacenˇm ESC'); delay(3000); clrscr; write('Program bezi'); HELP_roh;default; end; until Z=#27; clrscr; textcolor(White); write('Program sa vypˇna'); delay(400);write('.'); delay(400);write('.'); delay(400);write('.'); End.