Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Array or Dictionary

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Array or Dictionary
  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 >>
 Array or Dictionary - 10/4/2007 8:20:28 AM   
  mcds99


Posts: 424
Score: 4
Joined: 2/28/2006
Status: offline
This is part of an HTA
The msgbox displays each drive and sharename
The textarea only displays the last drive and sharename
   this always bugs me...

I'm not sure what is best to use an Array or Dictionary


      

_____________________________

Sam

Keep it Simple Make it Fun KiSMiF
 
 
Post #: 1
 
 RE: Array or Dictionary - 10/4/2007 8:33:26 AM   
  ehvbs

 

Posts: 2078
Score: 50
Joined: 6/22/2005
From: Germany
Status: offline
Hi mcds99,

use a dictionary if you need a collection of items accessible by (string) key ('name')

use an array if you need a collection of items accessible by (numerical) index ('number')

use neither if all you need is a couple of lines in a textarea:

   DispDrives.value = DispDrives.value & vbCrLf & "Drive: " & objDrive.path & " - " & objDrive.sharename

Keep it simple!

ehvbs

(in reply to mcds99)
 
 
Post #: 2
 
 RE: Array or Dictionary - 10/5/2007 12:13:00 AM   
  mcds99


Posts: 424
Score: 4
Joined: 2/28/2006
Status: offline
That is the best explanation of when to use an Array or Dictionary I've ever read.

Text use a Dictionary
Numeric use and Array

Thanks so much!

The solution is the "couple lines in a textarea" and it works great.

Thanks again.

_____________________________

Sam

Keep it Simple Make it Fun KiSMiF

(in reply to ehvbs)
 
 
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 >> Array or Dictionary 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