0

It's unfortunate to spend so many hours on a loop, but that I have. Below is a function which takes a NULL terminated string pointer and skips over new lines and /* comments /*. It should exit as long as the specific delimiter or comment is not present at the pointer. It wont exit!

void BOBJECT::EXPRESSignorewhite(char **in, int *line)
{
	while(1){
		if(**in == (char)10) {(*in)++; (*line)++; continue;}
		if(**in == (char)12) {(*in)++; (*line)++; continue;}
		if(**in == (char)13) {(*in)++; (*line)++; continue;}
		if(**in == ' ')      {(*in)++; continue;}
		if((**in == '/') && (*((*in) + 1) == '*')) {
			while(1){
				(*in)++;
				if(**in == (char)10) {(*line)++; continue;}
				if(**in == (char)12) {(*line)++; continue;}
				if(**in == (char)13) {(*line)++; continue;}
				if(**in == (char)0) {*in = 0; return;}
				if((**in == '*') && (*((*in) + 1) == '/')) {*in += 2; break;}
			}
			continue;
		}
		if(**in == 0)        {*in = 0; return;}
		break;    //THIS DOESN'T WORK!
	}
	return;
}
1
Contributor
1
Reply
2
Views
7 Years
Discussion Span
Last Post by mbrc
0

DISREGARD. Function works just fine. It's another sub that's calling it repetitively.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.