I would do the following:

When your form opens, lock your handle.

Use FldSetTextPtr for each of the fields, passing pointers to the embedded strings within the handle.

Unlock your handle when the form closes.


Neil


On Friday, March 21, 2003, at 07:47 AM, Veronica Loell wrote:

I am not editing any of theese fields, just displaying the data.
It seems like less overhead to actually attach the noneditable fields to the databaseinstead of creating new chunks and copy the data to them.


- Veronica Loell

Neil Rhodes wrote:
On Thursday, March 20, 2003, at 11:32 PM, Veronica Loell wrote:
I use the following calls to attach database info to the fields in my forms:
--
fldP = FrmGetObjectPtr (frmP, FrmGetObjectIndex (frmP, BGfldArbPlatsNamn));
FldSetText(fldP, recordH, OffsetOf(ppavotidRecEssarType,ap), sizeof(essP->ap));
--
This obviously increase the records lock value to a number that is equal to the number of fields included from that record. Hence increasing the risk of the record becoming over locked, andif I actually have 8 fields or more the record will get overlocked.


My solution is to unlock the record after each setting of Fld... = database value, and then locking it again before I set Fld... = NULL in my deInit function.

I was wondering if there is a better way to handle this as the solution I have arrived at seems a bit too much like a workaround?
You can't have multiple fields editing different parts of the same handle simultaneously. It just won't work. The Field Manager locks the handle you give it, and then assumes it can unlock the handle (once!) in order to resize the handle.
You can do like the table manager does;
Have a single field that you move from place-to-place, using it to edit whichever field contains the focus.
--
--
Neil Rhodes
Palm OS Certified Developer
Co-author: Palm Programming: the Developer's Guide
Available for contract programming
[EMAIL PROTECTED]


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

Reply via email to