D
Dave
Below is some code snippets that use an ArrayList,
I get the error below when trying to access the collection of PrevPrintJobs.
I can see the object in my debug watch window but the error is thrown at the
line with the asterix.
Is it possible to pass an arraylist of objects to another method?
ArrayList PrevPrintJobsCollection = new ArrayList();
class PrevPrintJobs
{
public string doc;
public string name;
public string time;
public string size;
}
static bool IfprevPrinted(PrevPrintJobs ppj, ArrayList ppjc)
{
System.Collections.IEnumerator myEnumerator =
ppjc.GetEnumerator();
if (ppjc.Count > 0)
{
while (myEnumerator.MoveNext())
if (ppjc[0].doc == ppj.doc)//*************error 1 here
{
return true;
break;
}
}
return false;
Error 1 'object' does not contain a definition for 'doc' and no extension
method 'doc' accepting a first argument of type 'object' could be found (are
you missing a using directive or an assembly reference?)
I get the error below when trying to access the collection of PrevPrintJobs.
I can see the object in my debug watch window but the error is thrown at the
line with the asterix.
Is it possible to pass an arraylist of objects to another method?
ArrayList PrevPrintJobsCollection = new ArrayList();
class PrevPrintJobs
{
public string doc;
public string name;
public string time;
public string size;
}
static bool IfprevPrinted(PrevPrintJobs ppj, ArrayList ppjc)
{
System.Collections.IEnumerator myEnumerator =
ppjc.GetEnumerator();
if (ppjc.Count > 0)
{
while (myEnumerator.MoveNext())
if (ppjc[0].doc == ppj.doc)//*************error 1 here
{
return true;
break;
}
}
return false;
Error 1 'object' does not contain a definition for 'doc' and no extension
method 'doc' accepting a first argument of type 'object' could be found (are
you missing a using directive or an assembly reference?)