I have this struct:

typedef struct {
 Char name[SIZE_NAME];
 Char id[SIZE_ID];
 Char phone[SIZE_PHONE];
 Char association[SIZE_ASSOCIATION];
 Char licenseNumber[SIZE_LIC_NUMBER];
 UInt8 age;
} personalInfoStruct

I have previously wrote some default data to a DmRecord using this
struct format.
I want to associante each field of this struct with a form's field
object. When handling frmOpenEvent, I think I should have done like
this:


   recordH = DmGetRecord(PersonalInfoDmRef, 0);

   FldSetText(GetObjectPtr(NameField),   recordH,
OffsetOf(personalInfoStruct, name),    SIZE_NAME);
   FldSetText(GetObjectPtr(IDField),    recordH,
OffsetOf(personalInfoStruct, id),    SIZE_ID);
   FldSetText(GetObjectPtr(PhoneField),   recordH,
OffsetOf(personalInfoStruct, phone),   SIZE_PHONE);
   FldSetText(GetObjectPtr(AssociationField), recordH,
OffsetOf(personalInfoStruct, association),   SIZE_ASSOCIATION);
   FldSetText(GetObjectPtr(NumberField),   recordH,
OffsetOf(personalInfoStruct, licenseNumber),  SIZE_LIC_NUMBER);

   FrmDrawForm ( frmP);
    handled = true;


When I receive a frmCloseEvent I doing this:

   FldSetText(GetObjectPtr(NameField),   NULL,
OffsetOf(personalInfoStruct, name),   SIZE_NAME);
   FldSetText(GetObjectPtr(IDField),    NULL,
OffsetOf(personalInfoStruct, id),    SIZE_ID);
   FldSetText(GetObjectPtr(PhoneField),   NULL,
OffsetOf(personalInfoStruct, phone),   SIZE_PHONE);
   FldSetText(GetObjectPtr(AssociationField), NULL,
OffsetOf(personalInfoStruct, association),   SIZE_ASSOCIATION);
   FldSetText(GetObjectPtr(NumberField),   NULL,
OffsetOf(personalInfoStruct, licenseNumber),  SIZE_LIC_NUMBER);
   DmReleaseRecord(PersonalInfoDmRef, 0, false);

    handled = false;


But, when the user edit the first field, for example, typing one char at
the end of it the remaining four field after the edited field are
shifted by one position, that is, any random char appears as the first
char of the others fields when I return to this form.

I could not understand clearly the purpose of the last parameter in
FldSetText function.

(I'm using CW with PALM SDK 4)

Thanks in advance.
Leonardo.



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to