CurrentRecord (RecordsetCursor function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<span class="pageSubtitle"><section begin=dpl_desc/><section end=dpl_desc/></span>
{{Template:RecordsetCursor:CurrentRecord subtitle}}
[[Category:RecordsetCursor methods|CurrentRecord function]]
<var>CurrentRecord</var> cancels the request if it cannot create a <var>Record</var> object because there is no
<p>
current record.
<var>CurrentRecord</var> is a member of the <var>[[RecordsetCursor class|RecordsetCursor]]</var> class.
</p>


This method returns a record object representing the
current record in the set, or it cancels the request if there is
no current record.
==Syntax==
==Syntax==
<p class="syntax">%rec = %rscursor:CurrentRecord( [lockstr]      -
{{Template:RecordsetCursor:CurrentRecord syntax}}
                [,&nbsp;LoopLockStrength=lockstr] )
 
</p>
===Syntax terms===
===Syntax terms===
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>%rec</th>
<tr><th>%record</th>
<td>A declared Record object variable for the assignment of the current record in ''%rscursor'''s record set. The variable must have the same file or group context as ''%rscursor''.
<td>A <var>Record</var> object variable for the assignment of the current record in <var class="term">recordsetCursor</var>'s record set. <var class="term">record</var> must have the same file or group context as <var class="term">recordsetCursor</var>.
</td></tr>
</td></tr>
<tr><th>%rscursor</th>
<tr><th>recordsetCursor</th>
<td>An instantiated <var>RecordsetCursor</var> object.
<td>A <var>RecordsetCursor</var> object.
</td></tr>
</td></tr>
<tr><th>lockstr</th>
<tr><th>lockStrength</th>
<td>The value of a <var>Lockstrength</var> enumeration: <var>None</var>, <var>Share</var>, or <var>Exclusive</var>. These correspond to standard <var class="product">Model 204</var> record-locking levels, as described below. The default lock strength is <var>Share</var>, matching the locking behavior of a <var class="product">User Language</var> <var>For Record Number</var> statement. <dl> <dt>None <dd>Record is not locked. <br> No locks are held on the object, so there is no conflict with others holding <var>Share</var> or <var>Exclusive</var> locks (readers and updaters may proceed). <dt>Share <dd>Record is share locked. <br> This level allows other users to hold a <var>Share</var> lock, but not an <var>Exclusive</var> lock (allows readers but not updaters to proceed). <dt>Exclusive <dd>Record is exclusively locked. <br> This level prohibits others from holding either an <var>Exclusive</var> lock or a <var>Share</var> lock. It is generally used for update. </dl>
<td>A <var>Lockstrength</var> [[Enumerations|enumeration]] value: <var>None</var>, <var>Share</var>, or <var>Exclusive</var>. These correspond to standard <var class="product">Model 204</var> record-locking levels, as described below. The default lock strength is <var>Share</var>, matching the locking behavior of a <var class="product">User Language</var> <var>For Record Number</var> statement. <dl> <dt>None <dd>Record is not locked. <br> No locks are held on the object, so there is no conflict with others holding <var>Share</var> or <var>Exclusive</var> locks (readers and updaters may proceed). <dt>Share <dd>Record is share locked. <br> This level allows other users to hold a <var>Share</var> lock, but not an <var>Exclusive</var> lock (allows readers but not updaters to proceed). <dt>Exclusive <dd>Record is exclusively locked. <br> This level prohibits others from holding either an <var>Exclusive</var> lock or a <var>Share</var> lock. It is generally used for update. </dl>
</td></tr>
</td></tr>
<tr><th><var>LoopLockStrength</var></th>
<tr><th><var>LoopLockStrength</var></th>
Line 27: Line 21:


</td></tr></table>
</td></tr></table>
==Usage Notes==
 
==Usage notes==
<ul>
<ul>
<li><var>CurrentRecord</var> is valid only if cursor state is <var>HasRecord</var>.
<li><var>CurrentRecord</var> is valid only if cursor state is <var>HasRecord</var>.
<li>The default lock strength of the new record object is <var>Share</var>.
<li>The default lock strength of the new record object is <var>Share</var>.
<li>For more information about enumerations, see [[Enumerations]].
</ul>
</ul>
==See also==
{{Template:RecordsetCursor:CurrentRecord footer}}

Latest revision as of 23:37, 22 February 2012

Create Record object from current record in the set (RecordsetCursor class)

CurrentRecord cancels the request if it cannot create a Record object because there is no current record.

Syntax

%record = recordsetCursor:CurrentRecord[( [lockStrength], - [LoopLockStrength= lockStrength])]

Syntax terms

%record A Record object variable for the assignment of the current record in recordsetCursor's record set. record must have the same file or group context as recordsetCursor.
recordsetCursor A RecordsetCursor object.
lockStrength A Lockstrength enumeration value: None, Share, or Exclusive. These correspond to standard Model 204 record-locking levels, as described below. The default lock strength is Share, matching the locking behavior of a User Language For Record Number statement.
None
Record 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).
Share
Record 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).
Exclusive
Record is exclusively locked.
This level prohibits others from holding either an Exclusive lock or a Share lock. It is generally used for update.
LoopLockStrength The lock strength to be used for For Record loops on the Record object. This is an optional, name required, parameter, and it defaults to None. Its possible values are described above.

Usage notes

  • CurrentRecord is valid only if cursor state is HasRecord.
  • The default lock strength of the new record object is Share.

See also