getting a directory's contents 
Author Message
 getting a directory's contents

Quote:

>    I recently wrote a program that will read a directory's
>contents and store them in an array.  This program was made using
>PDS 7.1  Please tell me what you think of it.

How's this for an improvement:

DEFINT A-R: DEFSTR S-Z     'a little idiosyncracy of mine
DIM zf(1000), lastfile, filespec$, x
INPUT "enter your file specification"; filespec$
lastfile=0
x = DIR$(filespec$)
WHILE len(x)
    lastfile=lastfile+1
    zf(lastfile)=x
    x=DIR$
WEND

Of course, in my programs, the last five lines would appear

WHILE len(x): lastfile=lastfile+1: zf(lastfile)=x: x=DIR$: WEND

Caveat -- the above is not tested, I didn't bother testing the code so
that I could reply quicker.  I'm 99 and 44/100% certain it will work as
written. Have Fun, safely.

John Knoderer

MAZE MAN COMPUTER SERVICES
101 Main Street SE
P O Box 744
Gravette, AR(kansas)  72736-0744

Yes, I'm the programmer that NBC did the story about in 1992. The story
hit most local newscasts on April 29, and NBC Nightside about the same
time.

Yes, I'm the programmer that wrote the first Star Trek game for
microcomputers way back in the TRS-80 Dark Ages, I released the Level I
TRS-80 version in January, 1978, the level II version that summer. With
all the copies that were made, I only heard from one recipient who sent
money. The first few copiers took my name out so that they could "legally"
copy it. This woman called seven different Radio Shacks around KC before
one would admit knowing who the author was -- she sent me $15. I
personally know of copies that made it to both coasts, and Radio Shack
editors pictured me playing my game in one issue of their INTERCOM
magazine, that got mailed to all of their dealers one October (late
seventies). Remind me to tell you the story of the time that another
programmer tried to come into my store to sell me my own program!

Yes, I'm the guy who opened and ran the first SOFTWARE CENTER in the U.S.
(perhaps the world). July, 1979 to September, 1981, in Saint Louis
(Florissant), MO.

This sure dates me, doesn't it?

John



Sat, 11 Apr 1998 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. getting a directory's contents

2. Getting directory list of a folder's contents

3. Getting Directory Contents in VB

4. getting the directory contents in vb

5. Getting the contents of a directory

6. Knowing when a directory's contents change

7. Getting Invisible Webbrowser's Content

8. Getting contents of another window's text box

9. Getting directory's name from CommonDialog?

10. Getting the application's directory?

11. Q: Getting EXE's Directory

12. Getting ALL directories & sub directories

 

 
Powered by phpBB® Forum Software