08.02.2013, 20:37
PHP код:
stock strrest(const string[], index)
{
new length = strlen(string);
new offset = index;
new result2[256]; // 7481
while ((index < length) && ((index - offset) < (sizeof(result2) - 1)) && (string[index] > '\r'))
{
result2[index - offset] = string[index];
index++;
}
result2[index - offset] = EOS;
return result2;
}
stock IsNumeric(const string2[]) // 7491
{
if(strlen(string2) > 15) return 0;
for (new i = 0, j = strlen(string2); i < j; i++)
{
if (string2[i] > '9' || string2[i] < '0') return 0;
}
return 1;
}
mystrtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}
new offset = index;
new result2[32]; // 7791
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result2) - 1)))
{
result2[index - offset] = string[index];
index++;
}
result2[index - offset] = EOS;
return result2;
}