Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


functions and default value

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> functions and default value
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 functions and default value - 6/3/2007 10:19:11 PM   
  pelegk2

 

Posts: 79
Score: 0
Joined: 3/27/2005
From: Israel
Status: offline
how do i define a default value for a param passed to a fnction?
for example
sub aaa(x1=3)
wscript.echo x1
end if

call aaa()==>>3
cal aaa(987)==>>987

so how do i define the default value?
thnaks
peleg
 
 
Post #: 1
 
 RE: functions and default value - 6/3/2007 10:57:03 PM   
  pelegk2

 

Posts: 79
Score: 0
Joined: 3/27/2005
From: Israel
Status: offline
ok found it
it works only in VB but there i a warkaorund
http://www.4guysfromrolla.com/webtech/071801-1.shtml

(in reply to pelegk2)
 
 
Post #: 2
 
 RE: functions and default value - 6/4/2007 1:44:10 AM   
  ebgreen


Posts: 5035
Score: 31
Joined: 7/12/2005
Status: online
VBScript does not allow for a default value to be assigned to a routine parameter.

_____________________________

"... 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 pelegk2)
 
 
Post #: 3
 
 
 
  

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 >> functions and default value Page: [1]
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