Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Dictionary or array

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Dictionary or array
  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 >>
 Dictionary or array - 10/18/2007 7:20:32 PM   
  gdewrance


Posts: 587
Score: 3
Joined: 3/16/2006
Status: offline
How can I make this neater either by use of dictionary or array


      
 
 
Post #: 1
 
 RE: Dictionary or array - 10/18/2007 7:49:54 PM   
  gdewrance


Posts: 587
Score: 3
Joined: 3/16/2006
Status: offline
So I was thinking along these lines
so it will be somthing like this, but how will I add a ubound statement to make this work

      

(in reply to gdewrance)
 
 
Post #: 2
 
 RE: Dictionary or array - 10/18/2007 9:56:38 PM   
  ehvbs

 

Posts: 2223
Score: 50
Joined: 6/22/2005
From: Germany
Status: offline
Hi gdewrance,

The most important line of the code:


      

is

  For nIdx = 0 To UBound( NethoodArray, 1 )

Good luck!

ehvbs

(in reply to gdewrance)
 
 
Post #: 3
 
 RE: Dictionary or array - 10/18/2007 10:16:10 PM   
  gdewrance


Posts: 587
Score: 3
Joined: 3/16/2006
Status: offline
Thanks ehvbs. Works perfectly

(in reply to ehvbs)
 
 
Post #: 4
 
 RE: Dictionary or array - 10/18/2007 11:33:44 PM   
  DiGiTAL.SkReAM


Posts: 1194
Score: 7
Joined: 9/6/2005
From: Florida, USA
Status: offline
My OCD wouldn't allow me to pass this up.  Why have two entries for each server/drive letter combo?

      

And I used a dictionary so that future additions/subtractions to/from the list of servers/drive letters would be as easy as adding or removing a single line.  That could even be done even smoother with an external file.


< Message edited by DiGiTAL.SkReAM -- 10/18/2007 11:38:47 PM >


_____________________________

"Would you like to touch my monkey?" - Dieter (Mike Meyers)

"It is better to die like a tiger, than to live like a pussy."
-Master Wong, from Balls of Fury

(in reply to gdewrance)
 
 
Post #: 5
 
 RE: Dictionary or array - 10/18/2007 11:51:40 PM   
  gdewrance


Posts: 587
Score: 3
Joined: 3/16/2006
Status: offline
 would your dictionary still be able to add a general share e.g \\server\shareName$

(in reply to DiGiTAL.SkReAM)
 
 
Post #: 6
 
 RE: Dictionary or array - 10/19/2007 8:12:38 AM   
  DiGiTAL.SkReAM


Posts: 1194
Score: 7
Joined: 9/6/2005
From: Florida, USA
Status: offline
Sure.

oDic.Add oDic.Count,"server04 sharename"

You just separate the server and share name with a space, however, this could easily be expanded to require a special character of some sort.


_____________________________

"Would you like to touch my monkey?" - Dieter (Mike Meyers)

"It is better to die like a tiger, than to live like a pussy."
-Master Wong, from Balls of Fury

(in reply to gdewrance)
 
 
Post #: 7
 
 RE: Dictionary or array - 10/23/2007 9:01:44 PM   
  gdewrance


Posts: 587
Score: 3
Joined: 3/16/2006
Status: offline
I also found this useful for creating multiple Desktop shortcuts


      

(in reply to gdewrance)
 
 
Post #: 8
 
 
 
  

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 >> Dictionary or array 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