Argh... I need help with strings = |
While this question isn't exactly C++ specific...
Code:
while (c < (sizeof(entires) )) {
c++;
achar = entires[c];
if (strcmp("^", achar)) {
DSPLINE+=8; }
if (strcmp("%", entires[c])) {
Rr = 220; Gg = 212; Bb = 8;
}
if (strcmp("$", entires[c])) {
Rr = Gg = Bb = 245;
}
if (strcmp("@", entires[c])) {
donet = true; break;
}
strcpy(tmptxt[c], entires[c]);
CLEV+=8;
displaytranstext(bitmd, tmptxt, X +CLEV+12, Y + DSPLINE+12, 244, 244, 244);
}
Anyways, what I'm trying to do is a message system for an RPG I'm writing. When you display a message box, the system goes through the string passed to it. If it encounters a "^", it breaks and goes to the next line. If it encounters a "%" it changes the text color, a "$" changes it back, and a "@" denotes the end of one message box of text.
The problem: I'm not sure how to do this, the code above is terrible, and everything I do seems to merit errors. Can someone help me out?