
Re: Is it possible to convert a character to its ASCII value
CHARLIB - gives general help
CHARLIB HELP - lists available commands
CHARLIB HELP ASC - gives detailed help about the ASC command
Here is one simple script to convert ASCII code 65 to character A and back again
Code:
call charlib chr 65 myChar
call charlib asc myChar 0 myCode
echo myChar=%myChar%
echo myCode=%myCode%
Finally, the end of CHARLIB.BAT (look at the source), is a TEST routine that exercises all the functions. Lots of examples there.
--------------------------------
I recommend renaming the command line calculator CALC.EXE to CLC.EXE so it is not confused with the Microsoft calculator.
The complete list of AutoIt functions is here:
http://www.autoitscript.com/autoit3/docs/functions.htmI think most of the functions are available in CLC.EXE
Sample usage:
Code:
clc asc("A")
clc chr(65)
To get results in variables:
Code:
for /f %%A in ('clc asc("A"^)') do set "myCode=%%A"
for /f %%A in ('clc chr(65^)') do set "myChar=%%A"
The closing ) in the CLC function call must be escaped as shown.
-----------------------------------------
Dave Benham