Difference between revisions of "CURSORGETPROP()"

From Lianjapedia
Jump to: navigation, search
 
Line 25: Line 25:
 
!width="30%"|Value||Description
 
!width="30%"|Value||Description
 
|-
 
|-
|1||Row and table buffering are off (default)
+
|3||Optimistic row buffering is on.  Note Lianja always sets buffering to 3.
|-
+
|2||Pessimistic row buffering is on
+
|-
+
|3||Optimistic row buffering is on
+
|-
+
|4||Pessimistic table buffering is on
+
|-
+
|5||Optimistic table buffering is on
+
 
|-
 
|-
 
|}
 
|}
Line 39: Line 31:
 
==Example==
 
==Example==
 
<code lang="recital">
 
<code lang="recital">
close databases
 
clear
 
set exclusive off
 
 
open database southwind
 
open database southwind
 
use customers
 
use customers
// Set to known value before start
+
? cursorgetprop("Buffering")
replace customerid with "ALFKI"
+
        3
 
+
cursorsetprop("Buffering", 5, "customers")
+
messagebox("Buffering set to " +etos(cursorgetprop("Buffering")))
+
 
+
? "Original customerid value: " + customerid
+
? "Curval(): " + curval("customerid")
+
? "Oldval(): " + oldval("customerid")
+
? "Fieldstate at start: " + getfldstate("customerid")
+
 
+
replace customerid WITH "LIANJ"
+
 
+
// Alter in another session
+
// update southwind!customers set customerid = 'MULTI' where recno() = 1
+
? "Someone else just updated the record!"
+
? "New customerid value: " +  customerid
+
? "Curval(): " + curval("customerid")
+
? "Oldval(): " + oldval("customerid")
+
? "Fieldstate after replace: " + getfldstate("customerid")
+
tablerevert(.T.)
+
 
+
? "Reverted customerid value: " +  customerid
+
? "Curval(): " + curval("customerid")
+
? "Oldval(): " + oldval("customerid")
+
? "Fieldstate after revert: " + getfldstate("customerid")
+
 
+
replace customerid WITH "LIANJ"
+
? "New customerid value: " +  customerid
+
tableupdate(.T.)
+
? "Updated customerid value: " +  customerid
+
? "Curval(): " + curval("customerid")
+
? "Oldval(): " + oldval("customerid")
+
? "Fieldstate after replace and update: " + getfldstate("customerid")
+
?
+
 
</code>
 
</code>
  

Latest revision as of 10:17, 28 March 2017

Purpose

Function to return the current property settings for a table or cursor

Syntax

CURSORGETPROP(<expC> [, <workarea | alias>])

See Also

CURSORSETPROP(), CURVAL(), GETFLDSTATE(), OLDVAL(), TABLEREVERT(), TABLEUPDATE(), SETFLDSTATE()

Description

The CURSORGETPROP() function can be used to return the current property settings for a table or cursor.

If the optional <workarea | alias> is specified, then the function will operate in the required location.

<expC>

Value Description
Buffering Current Buffering setting

Return Value

Value Description
3 Optimistic row buffering is on. Note Lianja always sets buffering to 3.

Example

open database southwind
use customers
? cursorgetprop("Buffering")
         3