Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


EMWProf caller login script

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> Post a VBScript >> EMWProf caller login script
  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 >>
 EMWProf caller login script - 6/16/2006 9:49:30 AM   
  SteveHarper

 

Posts: 2
Score: 0
Joined: 6/16/2006
From: Maryland
Status: offline

      

EDIT(EBGREEN): Added code tags, changed indentation, and removed personal contact information.

< Message edited by ebgreen -- 6/19/2006 12:21:12 AM >
 
 
Revisions: 2 | Post #: 1
 
 RE: EMWProf caller login script - 6/19/2006 12:14:11 AM  1 votes
  ebgreen


Posts: 5246
Score: 31
Joined: 7/12/2005
Status: offline
Thanks for sharing your script. The comment block at the top with the explanation of purpose and what a user would need to tweak in the script is great. I did put it into a code block to make it a little more browser friendly. There are some things that I would change if I were writing this script:

1) Global On Error Resume Next - I avoid using this if at all possible. It tends to mask errors that I need to know about to know when there is a problem with a script and what the problem is. I use it to specifically cover a single statement that I expect to have errors, but as I said I avoid using it globally.
2) This construct:
While strUser=""
strUser=wn.UserName
Wend
Has the potential to produce an infinite loop. Have there been specific situations where the WScript.Network object was unable to get the username but did get it if you tried repeatedly? I have never seen behavior like that.
3) Constant Names - By convention, constants are generally named with all caps to distinguish them as constants. It is not a hard and fas rule but most people follow the convention.
4) Function Names - While 'Run' is not a reserved keyword, it is a method of a WSH builtin object so that using it as a function name could be considered a little ambiguous.

_____________________________

"... 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 SteveHarper)
 
 
Post #: 2
 
 RE: EMWProf caller login script - 7/6/2006 2:44:07 AM   
  SteveHarper

 

Posts: 2
Score: 0
Joined: 6/16/2006
From: Maryland
Status: offline
Thank you for the great comments and suggestions.
In regard to the

While strUser=""
strUser=wn.UserName
Wend

comment, I have never seen it not get the username on the first try. There is a reason that I did that though, but I don't remember what it was. Probably could do an If statement instead of a while loop or even a direct asignment without the check would be fine.

strUser = wn.UserName

Thanks for the great comments.
steve

(in reply to ebgreen)
 
 
Post #: 3
 
 
 
  

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 >> EMWProf caller login script 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