Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>In all cases you indicate that the following line is generating the error:</p> <pre><code>return myspread.GetEnumerator();// Error on this line </code></pre> <p>Without knowing more about your code we can't really get to the bottom of this. It looks like you're trying to call the <code>GetEnumerator</code> method statically on the <code>myspread</code> class, which is probably not what you'd like it to do.</p> <p>I assume that you want your class to provide enumeration over the rows in the active sheet. Looking at the documentation <a href="http://www.clubfarpoint.com/FarPointSupportSite/Modules/Docs/SpreadWin5Help/index.html" rel="nofollow">here</a>, and specifically the docs for the <a href="http://www.clubfarpoint.com/FarPointSupportSite/Modules/Docs/SpreadWin5Help/FarPoint.Win.Spread~FarPoint.Win.Spread.Rows_members.html" rel="nofollow"><code>Rows</code> collection</a>, I'll make some guesses about how it might look:</p> <pre><code>class myspread : FarPoint.Win.Spread.FpSpread, IEnumerable&lt;FarPoint.Win.Spread.Row&gt; { public IEnumerable&lt;FarPoint.Win.Spread.Row&gt; GetEnumerator() { var rows = ActiveSheet.Rows; for (int i = 0; i &lt; rows.Count; ++i) yield return rows.Item[i]; } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } } </code></pre> <p>Of course if the <code>Rows</code> collection implemented <code>IEnumerable&lt;Row&gt;</code> then this would be simply a matter of doing:</p> <pre><code> public IEnumerable&lt;FarPoint.Win.Spread.Row&gt; GetEnumerator() { return ActiveSheet.Rows; } </code></pre> <p>The FarPoint documentation doesn't indicate any support for <code>IEnumerable&lt;Row&gt;</code> in the collection however.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload