Warcraft III resources & community, 2003–2006 · archived

AsciiIntegerToChar

not rated
Submitted by PepparVariable Change0 downloads
Returns the Ascii character indexed by i.

This is the counter-function to AsciiCharToInteger.

NOTE! You MUST place this function in the map root custom script section in the trigger editor. If you want to place this function somewhere else, replace the eigth line in the function with this:

return SubString(" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~", i - 32, i - 31)

Source

function AsciiIntegerToChar takes integer i returns string
    if i == 0 then
        return null
    elseif i >= 8 and i <= 10 then
        return SubString("\b\t\n", i - 8, i - 7)
    elseif i >= 12 and i <= 13 then
        return SubString("\f\r", i - 12, i - 11)
    elseif i >= 32 and i <= 127 then
        return SubString(" !\"#$%%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~", i - 32, i - 31)
    endif
    return ""
endfunction

Comments

0

No comments.