Skip to content
⌘ NSIS Forum Archive

Is there an ASC("A") = 65 equivalent function ?

8 posts

mhollander#

Is there an ASC("A") = 65 equivalent function ?

is there a function that can convert ans asc char like A to its numerical constant.


IntFmt command shown in the manual shows me how to convert from the constant to the character counterpart but I need to work it the otherway.

😕
mhollander#
How can I then use IntFmt to convert the following

StartLoop:
; Code that retrieves the single character into $R2
...
...
...
IntFmt $R6 "????" $R7
; Where $R6 contains the ascii value of the character.

Goto StartLoop


BTW. what are the values one can use for format.
kichik#
See this example of IntFmt:


The values possible are listed in the documentation. They are the same as printf's.
Mæster#
Re: Is there an ASC("A&quot😉 = 65 equivalent function ?

Originally posted by mhollander
is there a function that can convert ans asc char like A to its numerical constant.
IntFmt command shown in the manual shows me how to convert from the constant to the character counterpart but I need to work it the otherway.
Had the same problem today and finally wrote a function called CharToASCII to cover this:

Joost Verburg#
You function is identical to the Asc function, but it does not convert to ASCII. The Asc function converts characters to the current Windows codepage, this also includes non-ASCII characters.
Mæster#
You function is identical to the Asc function, but it does not convert to ASCII.
Searched a lot and didnt found it. Where can I find it? If there already is an Asc function I will remove mine from the archive.
Joost Verburg#
I mean the VB Asc function. The only think I wanted to say is that the name of your function is not totally correct (since it doesn't convert to ASCII).