Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > General > CALL Statement


Reply
 
Thread Tools Display Modes
  #1  
Old 08-19-2002, 12:20 PM
timbuktu's Avatar
timbuktu timbuktu is offline
Junior Contributor
 
Join Date: Jul 2002
Location: Under a rock
Posts: 277
Default CALL Statement


Hia,
Is it necessary to use the "Call" statement when going to another Sub? I have always been using just the name of the Sub when going to it, and it has always worked fine for me.
For example:
Code:
Private Sub Welcome() 'the sub being called Msgbox "Welcome" End sub Private Sub cmdOne_Click 'Should i put Welcome 'or Call Welcome 'to get the sub 'Welcome' to run? End Sub
Simple minds ask simple questions...
__________________
If your parents never had children, chances are you won't either
Reply With Quote
  #2  
Old 08-19-2002, 12:24 PM
Kikloo
Guest
 
Posts: n/a
Default

you can use both but You are not required to use the Call keyword when calling a procedure. However, if you use the Call keyword to call a procedure that requires arguments, argumentlist must be enclosed in parentheses. If you omit the Call keyword, you also must omit the parentheses around argumentlist. If you use either Call syntax to call any intrinsic or user-defined function, the function's return value is discarded.

To pass a whole array to a procedure, use the array name followed by empty parentheses
Reply With Quote
  #3  
Old 08-19-2002, 12:24 PM
Bucky's Avatar
Bucky Bucky is offline
A+ Certified Nerd

Retired Leader
* Expert *
 
Join Date: Dec 2001
Location: East Coast
Posts: 1,763
Default

Nope, the call command is strictly optional. There is an article
about this in the Tutors Corner here
__________________
If you're not part of the solution, you're part of the precipitate.
Reply With Quote
  #4  
Old 08-19-2002, 12:28 PM
timbuktu's Avatar
timbuktu timbuktu is offline
Junior Contributor
 
Join Date: Jul 2002
Location: Under a rock
Posts: 277
Default

Perfect
Thanks guys
__________________
If your parents never had children, chances are you won't either
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->