Call or Not Call

  • Thread starter Thread starter Jay
  • Start date Start date
J

Jay

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.
 
Jay said:
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()).Show()
///
 
where it is mandatory:
\\\
Call (New MainForm()).Show()
///

Why is it mandatory here? What happens to the instance when the call drops
out of scope? (just curious ;).
 
Robinson said:
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.
 
Jay said:
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.
 
Back
Top