This function has a bug:
int i = asc(chr(128));
if (i == -128)
{
MessageBox("Voilá!");
}
The situation is the same with all the characters from 128 to 255 on Windows-1251 codepage (maybe on others too).
It's easy to bypass if write like that:
// asc with positive native-characters
int masc(string c_str)
{
int i = asc(c_str);
if (i < 0) i += 256;
return i;
}