[HELP] strtok problem.
#6

pawn Код:
new cmd[256],tmp[256],idx;// at top of script

// at bottom of script.
strtok(const string[], &index)
{
  new length = strlen(string);
  while ((index < length) && (string[index] <= ' '))
  {
    index++;
  }
  new offset = index;
  new result[20];
  while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
  {
    result[index - offset] = string[index];
    index++;
  }
  result[index - offset] = EOS;
  return result;
}
Reply


Messages In This Thread
[HELP] strtok problem. - by kukars22 - 27.07.2009, 12:08
Re: [HELP] strtok problem. - by MenaceX^ - 27.07.2009, 12:09
Re: [HELP] strtok problem. - by kukars22 - 27.07.2009, 12:10
Re: [HELP] strtok problem. - by kukars22 - 27.07.2009, 12:24
Re: [HELP] strtok problem. - by Djiango - 27.07.2009, 12:31
Re: [HELP] strtok problem. - by RyDeR` - 27.07.2009, 13:11

Forum Jump:


Users browsing this thread: 1 Guest(s)