program Ascii_Table; uses crt; procedure writexy(text : string; row : byte; colour : byte); var len : byte; column : byte; begin len := length(text); column := 40-(len div 2); gotoxy(column,row); textcolor(colour); write(text); gotoxy(1,25); end; procedure help_page; var pause : char; begin textcolor(black); clrscr; writexy('Ascii Table v1.1',8,4); writexy('Programmed by Fraser King',9,4); writexy('To display a character in the Ascii Table. Simply',12,6); writexy('run the Ascii program and look up the character you',13,6); writexy('want. Then remember the code for that character.',14,6); writexy('At the command prompt hold down ALT and using',15,6); writexy('the numeric keypad type in the Ascii code.',16,6); writexy('Example. ALT + 65 displays the character A',19,4); pause := readkey; textcolor(lightgray); clrscr; halt; end; procedure display_ascii_table; var x,y : byte; i : integer; counter : byte; row : byte; ok : boolean; begin textcolor(black); clrscr; writexy('Ascii Table',1,2); writexy('Type at command prompt',24,2); writexy('Ascii /? for help page',25,2); row := 19; ok := FALSE; x := 1; y := 3; counter := 0; repeat for i := counter to counter + row do begin gotoxy(x,y); textcolor(7); write(i:4,' '); textcolor(2); write(chr(i):1); if i = 255 then begin ok := TRUE; i := i + 4; end; y := y + 1; end; y := 3; x := x + 6; counter := counter + 20; until ok; end; { Start of main program } var pause : char; begin textmode(80); if paramstr(1) = '/?' then help_page; display_ascii_table; pause := readkey; textcolor(lightgray); clrscr; end. { End of main program }