E
ewpatton
I have two preprocessing macros defined in my program:
#define SetBooleanAttribute(str, attr) else if(key->Equals(str)) \
##attr## = (settings->Attributes["value"]->Value=="true" ? true :
false);
#define SetStringAttribute(str, attr) else if(key->Equals(str)) \
##attr## = settings->Attributes["value"]->Value;
Then in my code I have the following:
1: if(key->Equals("version"))
2: this->version = settings->Attributes["value"]->Value;
3: SetStringAttribute("mode", this->mode);
4: SetStringAttribute("path", this->path);
5: else
6: MessageBox::Show("Unknown setting.", "Unknown",
MessageBoxButtons::OK);
But when I try to compile my program, the compiler states that I have
an invalid else without matching if on line 4, yet it seemed to handle
line 3 just fine.
What am I doing wrong?
Evan
#define SetBooleanAttribute(str, attr) else if(key->Equals(str)) \
##attr## = (settings->Attributes["value"]->Value=="true" ? true :
false);
#define SetStringAttribute(str, attr) else if(key->Equals(str)) \
##attr## = settings->Attributes["value"]->Value;
Then in my code I have the following:
1: if(key->Equals("version"))
2: this->version = settings->Attributes["value"]->Value;
3: SetStringAttribute("mode", this->mode);
4: SetStringAttribute("path", this->path);
5: else
6: MessageBox::Show("Unknown setting.", "Unknown",
MessageBoxButtons::OK);
But when I try to compile my program, the compiler states that I have
an invalid else without matching if on line 4, yet it seemed to handle
line 3 just fine.
What am I doing wrong?
Evan