- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
C# and nEOF
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-30-2012 02:24 PM
Anybody knows how to use nEOF in C#?
Here is my code:
using (DispatchObject invoice_line = new DispatchObject(invoice.GetProperty("oLines")))
{
int eof = 0;
retVal = invoice_line.InvokeMethod("nMoveFirst");
retVal = invoice_line.InvokeMethod("nEOF", eof); <-- error
LogMsg(string.Format("[Detail# Exists? {0}", retValText(eof)));
while (eof != 1) //detail exists
{
object[] getValueParams = new object[] { "ITEMCODE$", "" };
retVal = invoice_line.InvokeMethodByRef("nGetValue", getValueParams);
LogMsg(string.Format("[nGetValue] OK? {0}", retValText(retVal)));
LogMsg(string.Format("[{1}] {0}", getValueParams[1], "ITEMCODE$"));
//find next row
retVal = invoice_line.InvokeMethod("nMoveNext");
retVal = invoice_line.InvokeMethod("nEOF", eof);
LogMsg(string.Format("[Detail# Exists? {0}", retValText(eof)));
}
}
I am getting this:
Exception has been thrown by the target of an invocation.<Method name not found>
Thank you,
George
Solved! Go to Solution.
Re: C# and nEOF
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-30-2012 02:37 PM
I don't know the C# syntax. nEOF is a property of the invoice_line object, not a method.
Sr. Software Engineer
Sage 100 ERP
Re: C# and nEOF
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-30-2012 03:54 PM
use: int eof = invoice.GetProperty("nEOF")
or while( invoice.GetProperty("nEOF") != 1 ) { }
Re: C# and nEOF
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-31-2012 06:29 AM
Thank you, I did not realize it is the property ![]()


