How to check if a variable is holding any reference? RRS feed

  • Question

  • Hello,

       How to check whether a variable is actually holding a reference or not?

       For example, suppose that I have declared [just declared not instantiated] 'b' as a button and later in the code I want to check if b is holding any reference a Button object. How to do this?



    Wednesday, July 15, 2009 3:47 PM


  • Hi,
    You can also use
    if (b IsNot Nothing) Then
    'Holds a Reference
    Hope it helps
    FEAR NOT TO BE JUST Please mark posts as answers/helpful if it answers your query
    • Proposed as answer by Rahul P Nath Wednesday, July 15, 2009 4:19 PM
    • Marked as answer by Raraju Wednesday, July 15, 2009 4:24 PM
    Wednesday, July 15, 2009 4:18 PM

All replies