New (Recordset constructor)

From m204wiki
Revision as of 17:21, 13 April 2011 by JALWiccan (talk | contribs) (1 revision)
Jump to navigation Jump to search

<section begin=dpl_desc/><section end=dpl_desc/>

New is a member of the Recordset class.

This function makes a new, empty instance of a Recordset object.

Syntax

%newSet = [class:]New( [lockstrength] - [,&nbsp;LoopLockStrength=lockstrength] )

Syntax terms

%newSet An empty Recordset object created by this method.
class Either a class name that includes a file context in parentheses, as in %(Recordset in file sirLocal), or a variable in the class, as in %recSet.
lockstrength The lock strength of the instantiated Recordset object. Options are LockStrength enumeration values (None, Share, or Exclusive), which correspond to standard Model 204 record-locking levels, as described below. This is an optional parameter, and it defaults to Share.
None
Recordset is not locked.
No locks are held on the object, so there is no conflict with others holding Share or Exclusive locks (readers and updaters may proceed). Find Without Locks statements acquire this type of record lock.
Share
Recordset is share locked.
This level allows other users to hold a Share lock, but not an Exclusive lock (allows readers but not updaters to proceed). Find All Records statements acquire this type of record lock.
Exclusive
Recordset is exclusively locked.
This level prohibits others from holding either an Exclusive lock or a Share lock. It is generally used for update. Find And Reserve statements acquire this type of record lock.
LoopLockStrength=lockstrength 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

  • 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 )