SparkFun Forums 

Where electronics enthusiasts find answers.

For the discussion of Arduino related topics.
By brian25
i'm using gsm lib and i want to separate the content of smsbuffer. ex Hello World then i will disregard the Hello and i will only get the World and store in Another byte/char array. tnx
By brian25
i used arduino lib

Code: Select all
MatchState ms;
  char * str = smsbuffer;
  ms.Target (str);
  unsigned int index = 0;
  char buf [100];
  while (true)
  char result = ms.Match ("(%a+)" "(%-?%d+)", index);
   if (result == REGEXP_MATCHED){
     for (int j = 0; j < ms.level; j++);
     index = ms.MatchStart + ms.MatchLength;

can you help how to correct this one.. tnx
By mlu
There is a semicolon to much in the for statement:
Code: Select all
     for (int j = 0; j < ms.level; j++);
should be
Code: Select all
     for (int j = 0; j < ms.level; j++)
I think the compiler is complaining about this because with the extra semi colon, j
will not be defined on the next line.
Also the gsm.WritePhoneNumber looks wrong, what is the second argument ?