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


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.

:confused:


I'm afraid there isn't. You can use IntFmt in a loop or a plug-in.


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.


See this example of IntFmt:
http://nsis.sourceforge.net/archive/....php?pageid=61

The values possible are listed in the documentation. They are the same as printf's.


Re: Is there an ASC("A") = 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:

http://nsis.sourceforge.net/wiki/CharToASCII

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.


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.

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).