New (Recordset constructor): Difference between revisions
Jump to navigation
Jump to search
m (→Syntax terms) |
m (→Syntax terms) |
||
Line 14: | Line 14: | ||
</td></tr> | </td></tr> | ||
<tr><th>lockstrength</th> | <tr><th>lockstrength</th> | ||
<td>The | <td>The strength of the lock to be used for the records referenced by the object. This value is a [[LockStrength_enumeration|LockStrength enumeration]] value: <var>None</var>, <var>Share</var>, or <var>Exclusive</var>. | ||
This is an optional parameter, and it defaults to <var>Share</var>. | |||
</td></tr> | </td></tr> | ||
<tr><th><var>LoopLockStrength</var></th> | <tr><th><var>LoopLockStrength</var></th> | ||
<td>The lock strength to be used for loops on records in the <var>Recordset</var> object. This is an optional, [[Notation conventions for methods|name required]] parameter, available in <var class="product">Sirius Mods</var> 7.0 and later. It defaults to <var>None</var>. See [[Recordset class#LoopLockStrength for Recordsets|"LoopLockStrength for Recordsets"]]. | <td>The lock strength to be used for loops on records in the <var>Recordset</var> object. This is an optional, [[Notation conventions for methods|name required]] parameter, available in <var class="product">Sirius Mods</var> 7.0 and later. It defaults to <var>None</var>. See [[Recordset class#LoopLockStrength for Recordsets|"LoopLockStrength for Recordsets"]]. | ||
</td></tr></table> | </td></tr></table> | ||
==Usage notes== | ==Usage notes== |
Revision as of 13:06, 30 August 2012
Create a new Recordset object (Recordset class)
This function makes a new, empty instance of a Recordset object.
Syntax
%recordset = [%(Recordset In filOrGrp name):]New[( [lockStrength], - [LoopLockStrength= lockStrength])]
Syntax terms
%recordSet | An empty Recordset object created by this method. |
---|---|
[%(Recordset In filOrGrp name):] | The optional class name in parentheses denotes a Constructor. See "Usage notes", below, for more information about invoking a Recordset Constructor. |
lockstrength | The strength of the lock to be used for the records referenced by the object. This value is a LockStrength enumeration value: None, Share, or Exclusive.
This is an optional parameter, and it defaults to Share. |
LoopLockStrength | The lock strength to be used for loops on records in the Recordset object. This is an optional, name required parameter, available in Sirius Mods 7.0 and later. It defaults to None. See "LoopLockStrength for Recordsets". |
Usage notes
- As described in "Using New or other Constructors", New can be invoked with no object, with an explicit class specification, or with an object variable in the class, even if that object is Null:
%recset = new %recset = %(Recordset in file sirLocal):new %recset = %recset:new
Note: As shown above, when explicitly indicating the class, both the class name and the file context must be specified just as they are on the Recordset variable's declaration.
- Since the created Recordset object is empty, that is, contains no records, New needs to acquire no locks, so it cannot produce a record locking conflict.
- New is typically used in conjunction with AddRecord or AddRecordset, since without these methods, the object created by New is empty and therefore fairly uninteresting.
Examples
Example New statements follow:
%rs is object recordSet in foo %rs = new %rs = new( none ) %rs = new( exclusive ) %rs = new( share )