Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / VB.NET / November 2006

Tip: Looking for answers? Try searching our database.

Call or Not Call

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jay - 21 Nov 2006 14:42 GMT
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.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.