Function: asc
Displaying 1-1 of 1 total.
1
Please enter a numerical value for the importance of this sticky.
Enter 0 to unsticky.
ethereal

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;
}

Posted on 2006-10-14 16:12:36 (last edited on 2009-03-29 01:35:56)


Displaying 1-1 of 1 total.
1
 
Newest messages

Ben McGraw's lovingly crafted this website from scratch for years.
It's a lot prettier this go around because of Jon Wofford.
Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.