CurrentRecord (Record function): Difference between revisions
Jump to navigation
Jump to search
m (→Usage notes) |
m (→Syntax terms) |
||
Line 9: | Line 9: | ||
<table class="syntaxTable"> | <table class="syntaxTable"> | ||
<tr><th>%record</th> | <tr><th>%record</th> | ||
<td>A <var>Record</var> object variable to contain the instantiated object instance. This variable must be declared with the appropriate file or group context. See [[#Usage notes| | <td>A <var>Record</var> object variable to contain the instantiated object instance. This variable must be declared with the appropriate file or group context. See [[#Usage notes|Usage notes]], below.</td></tr> | ||
<tr><th nowrap="true"><var>[%(Record In </var>filOrGrp name<var>):]</var></th> | <tr><th nowrap="true"><var>[%(Record In </var>filOrGrp name<var>):]</var></th> | ||
<td>This optional specification of the class in parentheses denotes a [[Notation conventions for methods#Constructors|virtual constructor]]. See [[#Usage notes| | <td>This optional specification of the class in parentheses denotes a [[Notation conventions for methods#Constructors|virtual constructor]]. See [[#Usage notes|Usage notes]], below, for more information about invoking a <var>Record</var> virtual constructor. </td></tr> | ||
<tr><th>lockstr</th> | <tr><th>lockstr</th> | ||
Line 21: | Line 21: | ||
<tr><th><var>LoopLockStrength</var></th> | <tr><th><var>LoopLockStrength</var></th> | ||
<td>The lock strength to be used for loops on the <var>Record</var>. This is an optional, [[Notation conventions for methods#Named parameters|name required]], parameter, and it defaults to <var>None</var>. See [[Record class#LoopLockStrength for Records| | <td>The lock strength to be used for loops on the <var>Record</var>. This is an optional, [[Notation conventions for methods#Named parameters|name required]], parameter, and it defaults to <var>None</var>. See [[Record class#LoopLockStrength for Records|LoopLockStrength for Records]]. This parameter is available in <var class="product">Sirius Mods</var> 7.0 and later.</td></tr> | ||
</table> | </table> | ||
Revision as of 15:35, 26 August 2013
Create a Record object from current record in For loop or Recordset (Record class)
CurrentRecord is a shared function that acts as a constructor.
Syntax
%record = [%(Record In filOrGrp name):]CurrentRecord[( [lockStrength], - [LoopLockStrength= lockStrength])] Throws RecordLockingConflict
Syntax terms
%record | A Record object variable to contain the instantiated object instance. This variable must be declared with the appropriate file or group context. See Usage notes, below. |
---|---|
[%(Record In filOrGrp name):] | This optional specification of the class in parentheses denotes a virtual constructor. See Usage notes, below, for more information about invoking a Record virtual constructor. |
lockstr | The value of a Lockstrength enumeration: None, Share, or Exclusive. These correspond to standard Model 204 record-locking levels, as described below. The default lock strength of the new Record object is Share.
|
LoopLockStrength | The lock strength to be used for loops on the Record. This is an optional, name required, parameter, and it defaults to None. See LoopLockStrength for Records. This parameter is available in Sirius Mods 7.0 and later. |
Usage notes
- As described in Using CurrentRecord to instantiate a Record object, CurrentRecord must be invoked from a record context that has the same file or group context as declared for the Record object variable.
- As described in Virtual Constructor methods, CurrentRecord can be invoked with
no method object, with an explicit class specification, or with a Record object variable,
even if that object is Null:
%rec = CurrentRecord %rec = %(Record in file Myfile):CurrentRecord %rec = %rec:CurrentRecord
Note: As shown in the second of these above, if you explicitly specify the class name, you must include the file or group context, which must be the same as that declared for
%rec
.