Article View: alt.lang.basic
Article #60Re: storing directory into an array
From: Fred FREELAND
Date: Thu, 09 Apr 1992 18:51
Date: Thu, 09 Apr 1992 18:51
28 lines
2076 bytes
2076 bytes
In article <1992Apr3.062548.7308@cc.uow.edu.au> dryan@cc.uow.edu.au (David Ryan) writes: > I was wondering if it were possible to shell >out to dos, do a directory listing, but then store that listing into an >array so that I may have my way with the elements. The upshot of this being >that I would like to display the dir listing in a column rather than the >usual way that DOS does. By the way I am using Quickbasic 4.0. > Actually, what you can do is shell out to DOS, do a DIR and redirect the results to a file using the > character. Then you can open the file and strip off the excess garbage above and below the file list, and voila, you have the data you need. You can parse it a line at a time and do anything you like with the information. Of course, the Microsoft Professional Development System 7.1 contains a function (Dir$) which provides a much cleaner solution. But, that is considerably pricier that and old copy of QuickBASIC you've got laying around. Hope this helps. Viva la Basic! -- Frederick F. Freeland Jr. "Of all the things I've lost, Microsoft Corporation I miss my mind the most!" One Microsoft Way Redmond, WA 98052 (206) 882-8080 internet: fredf@microsoft.com arpanet: fredf%microsoft@uw-beaver.ARPA uucp: uunet!microsoft!fredf Opinions expressed over this signature are my OWN and not those of my employer!
Technical Details
Message-ID:
<1992Apr09.185106.22661@microsoft.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!microsoft!fredfReferences:
<1992Apr3.062548.7308@cc.uow.edu.au>Show Full Headers
Complete Article Headers
Newsgroups: alt.lang.basic Path: arc1-ca.pugleaf.net!sparky!uunet!microsoft!fredf From: fredf@microsoft.com (Fred FREELAND) Subject: Re: storing directory into an array Message-ID: <1992Apr09.185106.22661@microsoft.com> Date: 09 Apr 92 18:51:06 GMT Organization: Microsoft Corp. References: <1992Apr3.062548.7308@cc.uow.edu.au> Lines: 26