hello,
i have an application with a database.
i have a form where i fill in data which i want to keep in the database
record.
i creat a database and a record, and this stuff is ok.
the problem start here:
i get a pointer to the text of every field i have,
hFld1 = FldGetTextHandle ( ptrToTheField );
// FieldPtr ptrToTheField = (FieldPtr) FrmGetObjectPtr ( ptrToTheForm,
resorce_id);
CharPtr pFld1 = (CharPtr) MemHandleLock (hFld1);
and so on to Fld2, Fld3 ...
( not all the fiels r text fields, one is a Ctrl field and more )
then i set the fields values to the record,
Err err = DmWrite ( p, offset, TextP, StrLen ( TextP ) + 1 );
// p is a poiter to the record,
// offset is a number which i change according to the string length (it
works good, i know it for the
debugging process),
// TextP is the poiter to the text of the field. actually it points to
pFld1...N (N fields).
the problem start when i wand to draw Fld1, Fld2 and Fld3 in a table row
with the apropriate function. ( TableDrawFunc... )
to get the data of a fiels i call a sample function that return CharPtr,
the_Text = GetTheFieldText ();
GetTheFieldText is define like this -
CharPtr GetTheFieldText ( void )
{
return (pForm -> Fld1 );
}
// pForm is a pointer to my record structure,
// Fld1 is one of the field of the structure.
the function return the correct data for the first field. ( Fld1 is a
numeric field which can get 8 digit only).
for the secound fiels the data is not always right. if i enter to Fld1 all
the 8 digits then i get the right data for Fld2, but if i enter to Fld1,
lets say - 3 digits, i get only one or two chars from the Fld2 data. and
fld3 is totaly incorrect. (even when i enter 8 digits to Fld1 )
is anyone see an error?? is anyone has an idea how to see a record context
??
tnx in advance :-)
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/