Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


RE: Subs and Functions

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,40908
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> RE: Subs and Functions
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: <<   < prev  1 [2]
Login
Message << Older Topic   Newer Topic >>
 RE: Subs and Functions - 12/14/2006 9:31:11 AM   
  ebgreen


Posts: 5246
Score: 31
Joined: 7/12/2005
Status: online
I think I wasn't clear. I never maintained that there is anything wrong with using Call. I never do and I think it is confusing to use it but if you want to then knock yourself out. There is really just two things to remember if you avoid Call:

1) If the procedure returns a value, put () around the parameters.
2) If the procedure does not return a value, don't put () around parameters.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to TNO)
 
 
Post #: 21
 
 RE: Subs and Functions - 12/18/2006 7:46:00 AM   
  mcds99


Posts: 441
Score: 4
Joined: 2/28/2006
Status: offline
I was a COBOL programmer (please forgive me :-O) I was taught that "goto" was bad, but as we know...
"goto" works so it got used and abused, stay with me on this...

I figured out that a "goto" is best used by returning to the sending code unless the "goto" was an end point.

If I need to do something and that something is an end point I would use a "Sub" (closeing files and exiting).

If I need to do something and I need to return to do something else I would use a "Function" (reading, writing, etc...).

That's how I make the Sub vs. Function decision any way.

_____________________________

Sam

Keep it Simple Make it Fun KiSMiF

(in reply to ebgreen)
 
 
Post #: 22
 
 
Page:  <<   < prev  1 [2]
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> RE: Subs and Functions Page: <<   < prev  1 [2]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts