

Task

Given a character value in your language, print its code   (could be ASCII code, Unicode code, or whatever your language uses).



Example

The character   'a'   (lowercase letter A)   has a code of 97 in ASCII   (as well as Unicode, as ASCII forms the beginning of Unicode).

Conversely, given a code, print out the corresponding character.




 
\\ ANSI
Print Asc("a")
Print Chr$(Asc("a"))
\\ Utf16-Le
Print ChrCode("a")
Print ChrCode$(ChrCode("a"))
 
\\ (,) is an empty array.
 
Function Codes(a$) {
      If Len(A$)=0 then =(,) : Exit          
      Buffer Mem as byte*Len(a$)
      \\ Str$(string) return one byte character
      Return Mem, 0:=Str$(a$)
           Inventory Codes
      For i=0 to len(Mem)-1
      Append Codes, i:=Eval(Mem, i)
      Next i
      =Codes
}
Print Codes("abcd")
\\ 97 98 99 100
 