Difference between revisions of "CURSORSETPROP()"
From Lianjapedia
Helen.george (Talk | contribs) |
Yvonne.milne (Talk | contribs) |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 14: | Line 14: | ||
====<expC>==== | ====<expC>==== | ||
− | {| class="wikitable" width=100% | + | {| class="wikitable" width="100%" |
− | !width=30%|Value||Description | + | !width="30%"|Value||Description |
|- | |- | ||
|Buffering||Current Buffering setting | |Buffering||Current Buffering setting | ||
Line 22: | Line 22: | ||
====<expN>==== | ====<expN>==== | ||
− | {| class="wikitable"width=100% | + | {| class="wikitable" width="100%" |
!width=30%|Value||Description | !width=30%|Value||Description | ||
|- | |- | ||
Line 55: | Line 55: | ||
? "Fieldstate at start: " + getfldstate("customerid") | ? "Fieldstate at start: " + getfldstate("customerid") | ||
− | replace customerid WITH " | + | replace customerid WITH "LIANJ" |
// Alter in another session | // Alter in another session | ||
− | + | // update southwind!customers set customerid = 'MULTI' where recno() = 1 | |
? "Someone else just updated the record!" | ? "Someone else just updated the record!" | ||
? "New customerid value: " + customerid | ? "New customerid value: " + customerid | ||
Line 71: | Line 71: | ||
? "Fieldstate after revert: " + getfldstate("customerid") | ? "Fieldstate after revert: " + getfldstate("customerid") | ||
− | replace customerid WITH " | + | replace customerid WITH "LIANJ" |
? "New customerid value: " + customerid | ? "New customerid value: " + customerid | ||
tableupdate(.T.) | tableupdate(.T.) | ||
Line 81: | Line 81: | ||
</code> | </code> | ||
− | |||
− | |||
[[Category:Documentation]] | [[Category:Documentation]] | ||
[[Category:Functions]] | [[Category:Functions]] | ||
− | [[Category: | + | [[Category:Cursor Functions]] |
− | + |
Latest revision as of 13:37, 19 May 2014
Purpose
Function to define current property settings for a table or cursor
Syntax
CURSORSETPROP(<expC>, <expN> [, <workarea | alias>])
See Also
CURSORGETPROP(), CURVAL(), GETFLDSTATE(), OLDVAL(), TABLEREVERT(), TABLEUPDATE(), SETFLDSTATE()
Description
The CURSORSETPROP() function can be used to define 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 |
<expN>
Value | Description |
---|---|
1 | Row and table buffering off (default) |
2 | Pessimistic row buffering on |
3 | Optimistic row buffering on |
4 | Pessimistic table buffering on |
5 | Optimistic table buffering on |
Example
close databases clear set exclusive off open database southwind use customers // Set to known value before start replace customerid with "ALFKI" 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") ?