Subject Re: [IBO] FieldsTrimming. (Working with Fields and Parameters)
Author Helen Borrie
At 04:51 AM 26-10-02 +0930, you wrote:
>In the tech document "Working with Fields and Parameters":
>"These settings do not affect values that are stored in teh database
>tables, i.e. setting
>a trimming options does not cause the database value to modified."
>To me this statement implies that if I were to set a field's trimming
>property to SENTENCE
>then double-spaces and trailing-spaces would be removed for display
>purposes only.
>However, this is not the case. Changes are indeed made in the database.
>Is this a bug or is documentation incorrect or am I missing something?

You are missing something.

Unless you protect the data-aware controls and/or the dataset columns from
editing, the behaviour of the datalink (encapsulated in the datasource
component) in response to certain events, is to take any modified values
from the control and to update the dataset. Now, if the user happens to
click into the trimmed field during an edit, the control's image of the
field's value will get marked as "visited". Subsequent comparison of the
control's value with the dataset's value will tell the datalink that the
underlying dataset column has changed and the dataset column will get updated.

IOW, if the whitespace characters are *signficant* in your data, then don't
use the trimming attributes; or, if you do, then make the fields readonly,
or intercept the events that update the control or the dataset and revert
the value. You might be interested to look at the Oldxxxx properties of
TIB_Row and TIB_Column for some clues as to how to recover the original