State (RecordsetCursor function): Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
mNo edit summary |
||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
{{Template:RecordsetCursor:State subtitle}} | {{Template:RecordsetCursor:State subtitle}} | ||
==Syntax== | ==Syntax== | ||
{{Template:RecordsetCursor:State syntax}} | {{Template:RecordsetCursor:State syntax}} | ||
===Syntax terms=== | ===Syntax terms=== | ||
<table class="syntaxTable"> | <table class="syntaxTable"> | ||
<tr><th>% | <tr><th>%cursorState</th> | ||
<td> | <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> | <tr><th>recordsetCursor</th> | ||
<td> | <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 | |||
%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 | |||
... | |||
</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 ...