[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 5264
  • Last Modified:

char to ascii value

Here is a few lines of my pascal program

   a:=readkey;


after I read a key and want to determine the user is pressing what key
so I want to convert the char to a ascii value then I know what user pressed.

How to convert a char to its ascii value ?
0
adrianmak
Asked:
adrianmak
  • 3
1 Solution
 
sumant032199Commented:
Use,

ch := ord(a);

where ch is charater type data.
0
 
sumant032199Commented:
program ord;
begin
  Writeln('The ASCII code for "c" is ',
          Ord('c'), ' decimal');
end.

0
 
sumant032199Commented:
Thanks for your assessment.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now