在实际开发过程中,一个思维严谨的程序员通常会在用户退出某个窗口前检查窗口内的数据是否被修改,如果数据被改动过,则提醒用户是否保存修改.一个更加完美的例子就是在提醒用户的同时,高亮显示所有被改动过的行,下面是PB中高亮显示被修改过的数据窗口行的实用代码:
/**/
//
// Select (highlight) all rows that have been modified,dw_cust is a datawindow we worked on
/**/ //
long ll_row
if dw_cust.AcceptText() = - 1 then
return
end if
// Deselect everything
dw_cust.SelectRow ( 0 , false )
// Loop thru all modified rows and select them
do
ll_row = dw_cust.GetNextModified (ll_row, primary ! )
if ll_row > 0 then dw_cust.SelectRow (ll_row, true )
loop until ll_row < 1
// Select (highlight) all rows that have been modified,dw_cust is a datawindow we worked on
/**/ //
long ll_row
if dw_cust.AcceptText() = - 1 then
return
end if
// Deselect everything
dw_cust.SelectRow ( 0 , false )
// Loop thru all modified rows and select them
do
ll_row = dw_cust.GetNextModified (ll_row, primary ! )
if ll_row > 0 then dw_cust.SelectRow (ll_row, true )
loop until ll_row < 1