table.MARK_RANGE Function

Syntax

V Mark_Range(C Filter_Expr)

Arguments

Filter_Expr

Optional. Default = ".T." (all records in current query or range). A character filter expression that specifies which records in the table should be marked.

Description

Mark a range of records in the table.

Discussion

The <TBL>.MARK_RANGE() method is a high-level utility function used to mark selected records in a table. The operation is performed on the records in the table pointed to by the <TBL> object pointer. If the optional Filter_Expression is omitted, records in the current query or range are marked. If a Filter is included, the current query or range is ignored, and records that satisfy the Filter Expression are marked. Note : If you are marking records in a set with one-many child links off the parent table in which you are marking records, remember that if referential integrity is enabled, marking a parent record will result in all matching child records being marked as well.

Example 

This script marks California customer records.

dim tbl as P
tbl = table.open("d:\a5\a_sports\customer.dbf")
'Perform a query to find California customers.
query.filter = "State_prov = 'CA' "
query.order = "Recno()"
qry_ca_cust = tbl.query_create()
'Mark all records in current query by ommiting the optional filter expression
tbl.mark_range()
tbl.close()

This script ignores the current range and marks New York customers.

dim tbl as P
tbl = table.open("d:\a5\a_sports\customer.dbf")
'Perform a query to find Californiacustomers.
query.filter = "State_prov = 'CA' "
query.order = "Recno()"
qry_ca_cust = tbl.query_create()
'Mark all records in New York
tbl.mark_range("State_prov = 'NY' ")
tbl.close()

This script marks all of the records in a table individually without using the <TBL>.MARK_RANGE() method.

dim tbl as P
tbl = table.current()
tbl.fetch_first()
while .NOT. tbl.fetch_EOF()
    tbl.change_begin()
    tbl.mark()
    tbl.change_end(.T.)
    tbl.fetch_next()
end while

See Also