Call or Not Call

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jay

    Call or Not Call

    Is there a difference between using Call ProcName vs just using ProcName?
    If not, is it considered proper to use Call when calling another proc?
    Thanks.

  • Herfried K. Wagner [MVP]

    #2
    Re: Call or Not Call

    "Jay" <someone@somewh ere.comschrieb:
    Is there a difference between using Call ProcName vs just using ProcName?
    No.
    If not, is it considered proper to use Call when calling another proc?
    In VB6 I always used 'Call', but in VB I omit it except in one scenario
    where it is mandatory:

    \\\
    Call (New MainForm()).Sho w()
    ///

    --
    M S Herfried K. Wagner
    M V P <URL:http://dotnet.mvps.org/>
    V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

    Comment

    • Robinson

      #3
      Re: Call or Not Call

      where it is mandatory:
      >
      \\\
      Call (New MainForm()).Sho w()
      ///
      >
      Why is it mandatory here? What happens to the instance when the call drops
      out of scope? (just curious ;).



      Comment

      • Herfried K. Wagner [MVP]

        #4
        Re: Call or Not Call

        "Robinson" <toomuchspamhas passed@myinboxt oomuchtoooften. comschrieb:
        >where it is mandatory:
        >>
        >\\\
        >Call (New MainForm()).Sho w()
        >///
        >>
        >
        Why is it mandatory here? What happens to the instance when the call
        drops out of scope? (just curious ;).
        It stays alive because somewhere in the Windows Forms library a reference to
        the form prevents the form from being released.

        --
        M S Herfried K. Wagner
        M V P <URL:http://dotnet.mvps.org/>
        V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

        Comment

        • Phill W.

          #5
          Re: Call or Not Call

          Jay wrote:
          Is there a difference between using Call ProcName vs just using
          ProcName?
          (Double-check newsgroup ... dotnet ... OK)

          No difference at all.
          is it considered proper to use Call when calling another proc?
          I'd say "Ditch it"; it's just eye candy now.

          If you're still looking after VB "Proper" code, though, I would strongly
          recommend using Call there; it gets your code into better shape for when
          you need to migrate it to the newer "versions" of Visual Basic.

          HTH,
          Phill W.

          Comment

          Working...