[url]http://www.wc3jass.com/viewtopic.php?t=87[/url]
function AsciiCharToInteger takes string char returns integer
local string charMap = " !\"#$%%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"
local string u = SubString(char, 0, 1)
local string c
local integer i = 0
if u == "" or u == null then
return 0
elseif u == "\b" then // Backspace?
return 8
elseif u == "\t" then // Horizontal Tab?
return 9
elseif u == "\n" then // Newline
return 10
elseif u == "\f" then // Form feed?
return 12
elseif u == "\r" then // Carriage return
return 13
endif
loop
set c = SubString(charMap, i, i + 1)
exitwhen c == ""
if c == u then
return i + 32
endif
set i = i + 1
endloop
return 0
endfunction