Why does the compiler complain on this?

Hello all,

I have the following code in a web project to fill a list. If I get rid of the underscores at the end of the line to continue the list, it works. But leaving them in fails. I do not understand this behavior.

    grdAccess.AddRow ( Cstr(Session.eRemotes.Address), _
    Session.eRemotes.CommFormat, _
    Cstr(Session.eRemotes.CommPort), _
    Session.eRemotes.Funct, _
    Session.eRemotes.FireRelayOnCommFailure, _
    Session.eRemotes.GateMonitorActivated, _
    Cstr(Session.eRemotes.Module_Device_No), _
    Session.eRemotes.Module_Type_Name, _
    Cstr(Session.eRemotes.Module_Type_No), _
    Cstr(Session.eRemotes.MasterAddress), _
    Cstr(Session.eRemotes.MasterModule_Device_No), _
    Cstr(Session.eRemotes.MasterSlot), _
    Cstr(Session.eRemotes.MasterType), _
    Session.eRemotes.OnSiteAdd, _
    Session.eRemotes.OnSiteRemove, _
    Cstr(Session.eRemotes.Priority), _
    Cstr(Session.eRemotes.Relay_No), _
    Cstr(Session.eRemotes.Relay_OnTime), _
    Cstr(Session.eRemotes.Relay_Slot), _
    Cstr(Session.eRemotes.Relay_State), _
    Cstr(Session.eRemotes.RelayZone), _
    Cstr(Session.eRemotes.Slave) )

The compiler says that there is more than one ‘grdAccess.’ and is not sure which the code is referring to. There are not other objects called grdAccess.

Any explanations/ideas would be appreciated!

Hi Tim,

I just made a simple project eRemotes using your code and it compiles & works fine.

What’s the type of grdAccess?

FYI, you also get this error if there are zero signature matches.

So make sure you haven’t missed wrapping an integer variable in CStr().