My string is delimited with "~". I don't know if
StrStr would be a better choice but I am looping
through the string one char by one char and then using
StrCat to reform the substring.
static void DrawColumn(void *table, Int16 row, Int16
column, RectangleType *bounds) {
Char * P = TblGetItemPtr(table, row, column);
UInt16 len = StrLen(P);
UInt16 i;
UInt16 cnt = 0;
Char * str = "\0";
for (i = 0; i < len; i++) {
if (P[i] == '~') {
if (cnt == 0) {
WinDrawChars(str, StrLen(str), bounds->topLeft.x +
1, bounds->topLeft.y + 1);
str[0] = '\0';
cnt = cnt + 1;
} else if (cnt == 1) {
WinDrawChars(str, StrLen(str), bounds->topLeft.x +
1, bounds->topLeft.y + 13);
str[0] = '\0';
cnt = cnt + 1;
} else if (cnt == 2) {
WinDrawChars(str, StrLen(str), bounds->topLeft.x +
1, bounds->topLeft.y + 26);
str[0] = '\0';
cnt = cnt + 1;
}
} else {
StrCat(str, &P[i]);
}
}
/* draw the last line */
WinDrawChars(str, StrLen(str), bounds->topLeft.x + 1,
bounds->topLeft.y + 39);
}
__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/