Difference between revisions of "CHANGE()"

From Recital Documentation Wiki
Jump to: navigation, search
 
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==Class==
 
Manual Locking
 
 
 
 
==Purpose==
 
==Purpose==
 
Determine whether a record has been updated since it was last read
 
Determine whether a record has been updated since it was last read
Line 30: Line 26:
 
if not change()
 
if not change()
 
     replace customer.name with m.name,;
 
     replace customer.name with m.name,;
    customer.address with m.address,;
+
      customer.address with m.address,;
    customer.state with m.state
+
      customer.state with m.state
 
endif
 
endif
 
</code>
 
</code>
Line 37: Line 33:
  
 
==Products==
 
==Products==
Recital Database Server, Recital Mirage Server, Recital Terminal Developer
+
Recital Server, Recital  
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Functions]]
 
[[Category:Functions]]
 +
[[Category:Manual Locking]]
 +
[[Category:Manual Locking Functions]]

Latest revision as of 16:04, 27 November 2009

Purpose

Determine whether a record has been updated since it was last read


Syntax

CHANGE()


See Also

GATHER, READ, REPLACE , SET LOCKTYPE


Description

The CHANGE() function can be used in conjunction with SET LOCKTYPE TO OPTIMISTIC to determine whether a record has been updated since it was last read. If the records has been updated by another process since it was last read, the CHANGE() function will return .T. (TRUE), otherwise it will return .F. (FALSE).


Example

set locktype to optimistic
use customer
store automem
@1,1 get m.name
@2,1 get m.address
@3,1 get m.state
read
if not change()
    replace customer.name with m.name,;
      customer.address with m.address,;
      customer.state with m.state
endif


Products

Recital Server, Recital