29.02.2012, 22:38
My old version
pawn Код:
stock bool:IsHex(string[])
{
new pos[2] = {-1,-1},cnt,cur;
while((pos[0] = strfind(string, "{", true, (pos[0] + 1))) != -1)
{
cnt = 0;
for(new d = (pos[0]+1); d < (pos[0]+7); d++)
{
cur = string[d];
if(cur != '\0')
if(('0' <= cur <= '9') || ('A' <= cur <= 'F') || ('a' <= cur <= 'f'))
{
pos[1] = d;
cnt++;
}
}
if((cnt == 6) && (string[pos[1]+1] == '}'))
return true;
}
return false;
}