is "params" working as expected

  • Thread starter Thread starter Claire
  • Start date Start date
C

Claire

Hi, either I'm going mad or is params not working anymore in VS 2005?

I have function as follows
public tableEquipment[] ReadEquipment(bool ReadImages, params Int64[]
RecIDs)
{
}

if I call "tableEquipment equipment = myDatabase.ReadEquipment(false,
RecID);"
I'm getting a compiler error that "Error 1 Cannot implicitly convert type
Database.tableEquipment[]' to 'Database.tableEquipment' "
 
Claire said:
Hi, either I'm going mad or is params not working anymore in VS 2005?

I have function as follows
public tableEquipment[] ReadEquipment(bool ReadImages, params Int64[]
RecIDs)
{
}

if I call "tableEquipment equipment = myDatabase.ReadEquipment(false,
RecID);"
I'm getting a compiler error that "Error 1 Cannot implicitly convert type
Database.tableEquipment[]' to 'Database.tableEquipment' "

That's nothing to do with the parameters - it's to do with the return
value. The method returns an array, and you're trying to use it as if
it returns a single value.
 
omg, ignore me, brain didnt compute what the error message was telling me.
Reboot brain!
(should have typed "tableEquipment[] equipment =
myDatabase.ReadEquipment(false,
RecID);")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top