Milan wrote in message <33307@palm-dev-forum>...
>
>
>>>Hello all
>>>
>>>I have a PDB with multiple columns. When navigating through the records,
it
>>>always shows the first field in my table or text fields. But I also need
to
>>>show the other columns in my table and other text fields.
>>>
>>>If I have a data struct such as the one below with a PDB of the same
>>format,
>>>how would I put field3 in the 2nd column of my table or into a specific
>>text
>>>field?
>>>
>>>typedef struct
>>>{
>>> const char company [20];
>>> const char field1 [20];
>>> const char field2 [20];
>>> const char field3 [20];
>>>} CompanyDS;
>>>
>>
>>... well ... how did you show the -first- field?
>>
>Hi
>
>Good advice but still stuck. Below is what I do. I may not be doing this
>correctly or may need to use different functions since the
>FldSetTextHandle() does not accept a column value. Any other suggestions?
>
>------------------------------------------
>fld=FrmGetObjectPtr(frm,fldIndex);
>recHandle = DmGetRecord(CouponsDB, CurrentRecord);
>FldSetTextHandle(fld, recHandle);
>
Ok ... I didn't really give you any advise, I was trying to nudge
you in the right direction ... I can see we're gonna need a bigger
nudge ;-)
First -- stop thinking "columns". This isn't your classic SQL database,
or even MS Access. When you hear "database" in the Palm context,
think "file", because that's essentially what they are.
Second, you probably don't want to go passing the handle to a
db record to the Palm GUI library. I know you can, but I tend to
prefer an intermediate "working copy" so that you can implement
"ok" and "cancel" ... if your form directly modifies the record,
"cancel" is a pain in the touchis.
Get your record from the database, initialize the form w/ that
data, then when the form closes either copy the data back from
the form into your record ... or not, depending upon whether "ok"
or "cancel" was tapped.
If you really do want to do in-place editing w/o the intermediary,
look at void FldSetText (). The offset parameter there would
be used to point the (form) field at the proper (data struct) field.
--
-Richard M. Hartman
[EMAIL PROTECTED]
186,000 mi/sec: not just a good idea, it's the LAW!
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/