State (RecordsetCursor function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Template:RecordsetCursor:State subtitle}}
{{Template:RecordsetCursor:State subtitle}}
This [[Classes and Objects#readWrite|read-only]] method returns the current state of the cursor.
==Syntax==
==Syntax==
{{Template:RecordsetCursor:State syntax}}
{{Template:RecordsetCursor:State syntax}}
===Syntax terms===
===Syntax terms===
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>%cstate</th>
<tr><th>%cursorState</th>
<td>If specified, a declared enumeration object of type <var>CursorState</var> to contain the returned value of <var>State</var>. Possible values are <var>BeforeStart</var>, <var>HasRecord</var>, <var>AfterEnd</var>, <var>NoRecord</var>, and <var>Empty</var>, as described in [[RecordsetCursor class#Cursor state|"Cursor state"]].
<td>An <var>[[Enumerations|Enumeration]]</var> object of type <var>CursorState</var> to contain the returned value of <var>State</var>. Possible values are <var>BeforeStart</var>, <var>HasRecord</var>, <var>AfterEnd</var>, <var>NoRecord</var>, and <var>Empty</var>, as described in [[RecordsetCursor class#Cursor state|"Cursor state"]].</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></table>
</td></tr></table>
==Example==
==Example==
The following fragment suggests a way to use the <var>State</var>
The following fragment suggests a way to use the <var>State</var>
property with a cursor object:
property with a cursor object:
<p class="code"> %rs is object recordSet in file myfile
<p class="code">%rs is object recordSet in file myfile
%srecs is object SortedRecordset in file myfile
%srecs is object SortedRecordset in file myfile
%myCursor is object RecordsetCursor in file myfile
%myCursor is object RecordsetCursor in file myfile
  ...
...
fd to %rs
fd to %rs
end find
end find
  ...
...
sort records in %rs to %srecs by name
sort records in %rs to %srecs by name
  ...
...
%myCursor = %srecs:Cursor
%myCursor = %srecs:Cursor
fr in %srecs
fr in %srecs
  ...
...
repeat while ( %myCursor:State = hasrecord )
repeat while ( %myCursor:State = hasrecord )
end for
end for
  ...
...
</p>
</p>
==See also==
==See also==
{{Template:RecordsetCursor:State footer}}
{{Template:RecordsetCursor:State footer}}

Latest revision as of 21:06, 12 November 2012

Return current state of RecordSetCursor (RecordsetCursor class)

Syntax

%cursorState = recordsetCursor:State

Syntax terms

%cursorState An Enumeration object of type CursorState to contain the returned value of State. Possible values are BeforeStart, HasRecord, AfterEnd, NoRecord, and Empty, as described in "Cursor state".
recordsetCursor A RecordsetCursor object.

Example

The following fragment suggests a way to use the State property with a cursor object:

%rs is object recordSet in file myfile %srecs is object SortedRecordset in file myfile %myCursor is object RecordsetCursor in file myfile ... fd to %rs end find ... sort records in %rs to %srecs by name ... %myCursor = %srecs:Cursor fr in %srecs ... repeat while ( %myCursor:State = hasrecord ) end for ...

See also