Professional Documents
Culture Documents
Pbdoc
Pbdoc
Delete buffer
Filter buffer
Original buffer
DataStore
The GetItemStatus() function is used to determine the current status of either a row or
a column. The syntax is
DataWindowControl.GetItemStatus( Row, Column, DWBuffer)
The Row parameter identifies the row from which the status will be
obtained. Column specifies the column (either by number or name) for which you
want the status; if this is a 0, it returns the status of the row. The DWBuffer parameter
identifies the DataWindow buffer you want to check. The function returns a value of
type dwItemStatus.
The SetItemStatus() function is used to change the modification status of a row or
column to a different value. You use this function to influence the type of SQL
statements that will be generated for a row. The syntax is
DataWindowControl.SetItemStatus( Row, Column, DWBuffer, Status)
The Row parameter identifies the row for which the status will be
changed. Column specifies the column (either by number or name) whose status you
want to change; if this is 0, the status of the row is changed. The DWBuffer parameter
identifies the DataWindow buffer you want to change. The status is of type
dwItemStatus.
If you change the status of a row's modification flag, it also affects the flags of all the
row's columns and vice versa. That is, setting a row to NotModified! or New! will
cause all the columns to become NotModified!. You must be aware that not all status
changes are legal, and you might have to go through an additional step to set a row or
column to a particular status. The status might actually change to a third value that is
different from both the original and the intended values.
Table 14.1 shows the effect of changing from one status to another. An entry of Yes
means that the translation is allowed. An entry of No means that there is no change
made. If a specific dwItemStatus value is shown, it is the new status of the row or
column rather than the desired one.
You can reach a desired status that is not allowed directly by changing the status to an
allowable intermediary one. For example, to change a status of New! to
NotModified!, you first must make it DataModified!.
You can encapsulate the information in this table into a function (see Listing 14.1) to
be used throughout an application, either as a global or DataWindow user object
function. This function is very useful for controlling DataWindow updates; it can
cause some rows not to save or direct others to become updates rather than inserts.