ComponentOne True DataControl 8.0
Expression Scope Levels

At any given time, the state of a TData control is at record level or recordset level.

A TData control is at record level if it is either in the process of retrieving a record from the database, or has already positioned to a specific record. In this case all of its fields have definite values.

A TData control is at recordset level if it is in the process of populating the recordset, in which case the set of records is still undetermined and the control is not positioned on any particular record. Field values are undefined in this situation.

Accordingly, all True DataControl expressions can be divided into two groups: those belonging to the record level, and those belonging to the recordset level. The level of an expression is determined by the timing of its evaluation. For example, a calculated expression is evaluated in the scope of one record, so it belongs to the record level. Conversely, a range expression is evaluated before the recordset is populated, so it belongs to the recordset level. If you are unsure which level a particular expression belongs to, see Expression Evaluation Rules.

A recordset level expression cannot use the fields of the TData control for which it is defined, since the values of these fields will be undefined when the expression is evaluated. The True DataControl Expression Editor enforces this restriction by not displaying the control's fields when opened on a recordset level expression such as a range condition. However, recordset level expressions can use the control's parameters, as well as all variables (including fields) of ancestor TData controls (in master-detail relationship), if there are any.

Some True DataControl events also belong to either the record or recordset level depending upon the timing and conditions that trigger the event. You cannot retrieve field values by writing code in a recordset level event. Similarly, you cannot change a field value in a recordset level event.

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback