Convert CHAR to INTEGER
Posted: Tue Feb 01, 2011 11:03 am
How do I convert a CHAR (from serial input) to an INTEGER?
A technical support group for Astrobe Oberon users
https://astrobe.com./forum/
Code: Select all
VAR
ch: CHAR;
i: INTEGER;
...
...
i := ORD(ch);
Code: Select all
IF ('0' <= ch) & (ch <= '9') THEN i := ORD(ch) - ORD('0') END;