22 lines
479 B
Plaintext
22 lines
479 B
Plaintext
Prgm
|
|
Local k, s
|
|
ClrIO
|
|
Loop
|
|
Disp "Press a key, or ON to exit."
|
|
getKey() © clear buffer
|
|
0 → k : While k = 0 : getKey() → k : EndWhile
|
|
ClrIO
|
|
If k ≥ 256 Then
|
|
Disp "Not a character."
|
|
Disp "Code: " & string(k)
|
|
Else
|
|
|
|
char(k) → s ©
|
|
© char() and ord() are inverses. ©
|
|
Disp "Character: " & s ©
|
|
Disp "Code: " & string(ord(s)) ©
|
|
|
|
EndIf
|
|
EndLoop
|
|
EndPrgm
|