Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Example Script for VBS Class

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> Post a VBScript >> Example Script for VBS Class
  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 >>
 Example Script for VBS Class - 10/26/2005 6:47:38 AM   
  kirrilian


Posts: 627
Score: 3
Joined: 3/15/2005
From:
Status: offline
I gave a scripting class for my co-workers and I used this script for examples. I thought it would make an excellent script to post here since it is HEAVILY commented. 



      

_____________________________

Have you searched here ?
VBScript Fundamentals
My Site
 
 
Post #: 1
 
 RE: Example Script for VBS Class - 10/26/2005 11:43:53 PM   
  mbouchard


Posts: 1779
Score: 12
Joined: 5/15/2003
From: USA
Status: offline
Nope, not enough comments.  Must be at least double the length of your script. 

J/K, this is a great script.  Will pin it if you don't mind.

_____________________________

Mike

For useful Scripting links see the Read Me First stickey!

Always remember Search is your friend.

(in reply to kirrilian)
 
 
Post #: 2
 
 RE: Example Script for VBS Class - 10/27/2005 2:20:16 AM   
  kirrilian


Posts: 627
Score: 3
Joined: 3/15/2005
From:
Status: offline
Don't mind a bit. 

_____________________________

Have you searched here ?
VBScript Fundamentals
My Site

(in reply to mbouchard)
 
 
Post #: 3
 
 RE: Example Script for VBS Class - 11/6/2005 12:06:44 AM   
  Cybertwister

 

Posts: 20
Score: 0
Joined: 11/6/2005
Status: offline
great 

(in reply to kirrilian)
 
 
Post #: 4
 
 RE: Example Script for VBS Class - 12/21/2005 5:23:00 AM   
  ebgreen


Posts: 4408
Score: 29
Joined: 7/12/2005
Status: offline
One small quibble with this comment:

quote:

'gotcha: if you dont use global variables defined at the beginning
'of the script a function is useless.


I actually stress the avoidance of global variables. Avoiding them complies with the Law of Demeter, decreases coupling, increases orthogonality, and increases code reusability.

_____________________________

"... 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 Cybertwister)
 
 
Post #: 5
 
 RE: Example Script for VBS Class - 12/21/2005 5:25:17 AM   
  ebgreen


Posts: 4408
Score: 29
Joined: 7/12/2005
Status: offline
One more:

quote:

'the easiest way to increment a dynamic array is To
'maintain a variable and increment it each time you
'increase the size of the Array


I find that using UBound to resize arrays is better because that way you don't need to keep track of the array length seperately. If the object (array) has a built in property to do this for me, why should I do it myself?

_____________________________

"... 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 #: 6
 
 RE: Example Script for VBS Class - 1/4/2006 3:44:27 AM   
  kirrilian


Posts: 627
Score: 3
Joined: 3/15/2005
From:
Status: offline
yea ive since learned different on both points, i just havent updated this script to reflect this, thanks for the comments

_____________________________

Have you searched here ?
VBScript Fundamentals
My Site

(in reply to ebgreen)
 
 
Post #: 7
 
 RE: Example Script for VBS Class - 11/30/2007 3:16:03 PM   
  kirrilian


Posts: 627
Score: 3
Joined: 3/15/2005
From:
Status: offline
I have updated this script, changed things to reflect ebgreen's comments as well as added some new stuff

I would've just edited the top post but it seems that I cant, so here it is again:


      

_____________________________

Have you searched here ?
VBScript Fundamentals
My Site

(in reply to kirrilian)
 
 
Post #: 8
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> Post a VBScript >> Example Script for VBS Class 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