CurrentRecord (Record function): Difference between revisions
Jump to navigation
Jump to search
m (1 revision) |
mNo edit summary |
||
Line 6: | Line 6: | ||
===Syntax terms=== | ===Syntax terms=== | ||
<table class="syntaxTable"> | <table class="syntaxTable"> | ||
<tr><th><var>%(Record)</var></th> | <tr><th nowrap="true"><var>[%(Record In <i>filOrGrp name</i>)]</var></th> | ||
<td> | <td>For a shared function, this optional specification of the class in parentheses denotes a [[Notation conventions for methods#Shared methods|virtual constructor]]. See [[#Usage notes|"Usage notes"]], below, for more information about invoking a <var>Record</var> virtual constructor. | ||
</td></tr> | </td></tr> | ||
<tr><th>lockstr</th> | <tr><th>lockstr</th> | ||
Line 18: | Line 18: | ||
==Usage notes== | ==Usage notes== | ||
<ul> | <ul> | ||
<li><var>CurrentRecord</var> must be invoked from | <li>As described in [[Record class#Using CurrentRecord to instantiate a Record object|"Using CurrentRecord to instantiate a Record object"]], <var>CurrentRecord</var> must be invoked from a record context | ||
that has the same file or group context as declared for the <var>Record</var> | that has the same file or group context as declared for the <var>Record</var> | ||
object variable. | object variable. | ||
<li> | <li>As described in [[Object variables#Virtual Constructor methods|"Virtual Constructor methods"]], <var>CurrentRecord</var> can be invoked with | ||
no method object, with an explicit class specification, or with a <var>Record</var> object variable, | |||
< | even if that object is <var>Null</var>: | ||
<p class="code">%rec = CurrentRecord | |||
%rec = %(Record in file):CurrentRecord | |||
%rec = %rec:CurrentRecord | |||
</p> | |||
'''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 <code>%rec</code>. | |||
</ul> | </ul> | ||
==See also== | ==See also== | ||
{{Template:Record:CurrentRecord footer}} | {{Template:Record:CurrentRecord footer}} |
Revision as of 23:11, 22 August 2011
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 In filOrGrp name)] | For a shared function, 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):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
.