🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.basic.visual
Article #287

Re: Error with the function Dir

#287
From: Jonathan Allen
Date: Thu, 18 May 2000 00:00
31 lines
1446 bytes
Try using File System Objects instead of Dir. You may find it more
effective.


Private Sub Command1_Click()
Dim FSO As New FileSystemObject
Dim d As Folder
     For Each d In FSO.GetFolder("c:\").SubFolders
          Debug.Print d.Name
     Next d
End Sub

Make sure you add "Microsoft Scripting Runtime" to your references list in
the project menu.

Jonathan Allen
Owyn Latane wrote in message <8fqnb0$1j6n$1@news.cybercity.dk>...
>Hi.
>
>Can anyone please tell me what is wrong here?
>
>Dim sPath As String
>Dim sDir As String
>    sPath = "C:\"
>    sDir = Dir(sPath, vbDirectory)
>
>I get a "Wrong number of arguments or invalid property assignment." error.
>
>Please reply in english or danish.
>
>
Technical Details
Message-ID: <8g1aov$l83$1@thoth.cts.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <8fqnb0$1j6n$1@news.cybercity.dk>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f51ba,13911145b9a64af1
X-Google-Attributes: gidf51ba,public
X-Google-Thread: f645d,13911145b9a64af1
X-Google-Attributes: gidf645d,public
From: "Jonathan Allen" <greywolfcs@bigfoot.com>
Subject: Re: Error with the function Dir
Date: 2000/05/18
Message-ID: <8g1aov$l83$1@thoth.cts.com>
X-Deja-AN: 625075664
References: <8fqnb0$1j6n$1@news.cybercity.dk>
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3155.0
X-Complaints-To: newsmaster@cts.com
X-Trace: thoth.cts.com 958672480 21763 216.120.1.173 (18 May 2000 17:54:40 GMT)
Organization: Greywolf Computer Systems
Newsgroups: comp.lang.basic.visual,dk.edb.programmering.basic.visual-basic