In that case, the error is not coming from any of the parameters as
you've described them, as they all accept Nothing as a valid value, or
this is optimized code.

If this is called with SomeObj.AddCustomer(...) then SomeObj is Nothing.

Also, of course, if some of the arguments are expressions that may
contain Nothing, you can Step Into the specific evaluations since
VS2008 (at least).

Otherwise your (possibly optimized) code is not reporting the position
of the error correctly.

-- 
Regards,
Mark Hurd, B.Sc.(Ma.)(Hons.)

On 8 April 2014 20:47,  <anthonyatsmall...@mail.com> wrote:
> Exception occurs at the function call, don't get a chance to step through
>
> -----Original Message-----
> From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com]
> On Behalf Of Sam Lai
> Sent: Tuesday, 8 April 2014 8:25 PM
> To: ozDotNet
> Subject: Re: Debugging Function parameters
>
> I haven't done VB.NET for a long while so this is probably a silly question,
> but why can't you just step into that function see where it is failing?
>
> On 8 April 2014 18:10,  <anthonyatsmall...@mail.com> wrote:
>> I have a function with  about 10 arguments,  one of the variables is
>> failing,  ie Object reference not set to an instance of an object.
>>
>>
>>
>> Is it possible to determine which variable is causing the issue?
>>
>>
>>
>>
>>
>> Public Function AddCustomer(ByVal CustomerId As Nullable(Of Integer),
>> ByVal Company As String, ByVal TradingAs As String, ByVal AccessName
>> As String, ByVal Address As String, ByVal Address2 As String, ByVal
>> Suburb As String, ByVal State As String, ByVal Postcode As String,
>> ByVal CountryId As Integer, ByVal PostalAddress As String, ByVal
>> PostalAddress2 As String, ByVal PostalSuburb As String, ByVal
>> PostalState As String, ByVal PostalPostcode As String, ByVal
>> PostalCountryId As String, ByVal Phone As String, ByVal Fax As String,
>> ByVal Email As String, ByVal Firstname As String, ByVal Lastname As
>> String, ByVal UserEmail As String, ByVal Username As String, ByVal
>> UserPassword As String, ByVal Website As String, ByVal Mobile As
>> String)

Reply via email to