|
-
Oct 3rd, 2007, 06:40 AM
#1
Thread Starter
Fanatic Member
[RESOLVED] Array Q
I'm on a roll here so bear with me...
In amking an array, the array needs to be DIMMed prior to filling. Using this code I can count all the drives, but I want to put the drive letters in an array.
<code>
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set colDrives = objFSO.Drives
i=0
For Each objDrive in colDrives
i=i+1
Next
i=int(i)
dim Xdrive(i)
</code>
when the code reaches the DIM statement, it fails saying it needs an integer. I tried to change the value from Csng to INT, but it still fails.
Any ideas guys?
-
Oct 3rd, 2007, 07:06 AM
#2
Thread Starter
Fanatic Member
Re: Array Q
Ok got it. I made a dynamic array instead.
-
Oct 3rd, 2007, 07:11 AM
#3
Re: [RESOLVED] Array Q
Code not tested.But will work
Code:
Dim i
Dim drvs() 'For storing the drivename
i=0
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set colDrives = objFSO.Drives
For Each objDrive in colDrives
i=i+1
drvs(i)=objDrive.Name 'Store the drive name
Next
Please mark you thread resolved using the Thread Tools as shown
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|