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] - 21 Nov 2006 14:49 GMT
"Jay" <someone@somewhere.com> schrieb:
> 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()
///

Signature
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Robinson - 21 Nov 2006 15:03 GMT
> 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 ;).
Herfried K. Wagner [MVP] - 21 Nov 2006 15:20 GMT
"Robinson" <toomuchspamhaspassed@myinboxtoomuchtoooften.com> schrieb:
>> where it is mandatory:
>>
[quoted text clipped - 4 lines]
> 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.

Signature
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Phill W. - 22 Nov 2006 15:20 GMT
> 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.