Hi there,
I read your posts about TblSetItemPtr() and TblGetItemPtr(). Both of these functions
are available
on PalmOS 3.5 so you don't need to use
tableP->items[row * tableP->numColumns + column].ptr
I didn't use TblSetItemPtr() and IblGetItemPtr() before. I do use TblSetItemInt() and
I always set
it to be the record number (in the database).
What is the code around your while loop ?
/* Put the data after the time, if any, into the table ptr item. */
CharPtr pRec;
Char szEndPoint[ 30 ];
Int16 nDay = 0;
StrCpy( szEndPoint, "1534f" );
Char ch = szEndPoint[ nDay ];
/* Go through string looking for the first non-numeric char. */
while ( ch && ch >= '0' && ch <= '9' )
{
nDay++;
ch = szEndPoint[ nDay ];
}
if ( ch )
{
pRec = szEndPoint + nDay;
}
else
pRec = NULL;
TblSetItemPtr( pBusTimes, i, nColumn, pRec );
How "i" and "nColumn" effect "szEndPoint" ?
>From your code, pRec is &szEndPoint[4] , so the value is the string "f" until you
>modify
szEndPoint, the value may change.
I think the memory that "pRec" points to in TblSetItemPtr() must be available for the
table
pBusTimes during the life time of that table.
I would think on your table, each row will have different value (not "15:34 ?", ? is a
character).
If you take these values from a database, may be you just need to set TblSetItemInt()
to record
number and in your custom draw function, you retrieve the record by the record number
(index of
the record) and draw... That is what I saw in the samples program and I always do that
in my
programs.
The memopad project (tutorial) shows you how to do all of these.
tnn
__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/