Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


RE: VBScript - Writing Func/Sub that can take 0 or 1 args?

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> RE: VBScript - Writing Func/Sub that can take 0 or 1 args?
  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: VBScript - Writing Func/Sub that can take 0 or 1 args? - 1/30/2008 6:45:01 AM   
  ebgreen


Posts: 4971
Score: 31
Joined: 7/12/2005
Status: offline
You are correct ehvbs. I should have more explicitly stated:

Notice that the delimited string method is really the same as the array method (for purely string data) with the array creation moved into the function.

_____________________________

"... 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 ebgreen)
 
 
Post #: 21
 
 RE: VBScript - Writing Func/Sub that can take 0 or 1 args? - 1/30/2008 9:22:06 PM   
  humbletech99

 

Posts: 53
Score: 0
Joined: 6/9/2007
Status: offline
I don't think that passing in arrays or dictionaries is very nice unless you want zero or many args. In this case, I want a string or nothing, but the best way to do this seems to be to use a string or a null, which is basically just the same as my original idea of passing in an empty string and testing for this.

So I will make the functions test for an empty string or null and this should then be fine.

Thanks

_____________________________

value(geeks) > value(mundanes)

(in reply to ebgreen)
 
 
Post #: 22
 
 RE: VBScript - Writing Func/Sub that can take 0 or 1 args? - 1/31/2008 4:52:47 AM   
  ehvbs

 

Posts: 2173
Score: 50
Joined: 6/22/2005
From: Germany
Status: offline
Hi humbletech99,

just in case you are interested in the question, why I proposed to use Empty instead of
"" (and now null), read

   http://blogs.msdn.com/ericlippert/archive/2003/09/30/53120.aspx

Regards

ehvbs

(in reply to humbletech99)
 
 
Post #: 23
 
 
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: VBScript - Writing Func/Sub that can take 0 or 1 args? 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