home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Media Share 9
/
MEDIASHARE_09.ISO
/
progmisc
/
euphor10.zip
/
GETNAMES.E
< prev
next >
Wrap
Text File
|
1993-01-18
|
865b
|
42 lines
-- get file names from dir command
function no_blanks(sequence x)
-- squeeze out all blanks in a string
sequence nbx
nbx = ""
for i = 1 to length(x) do
if x[i] != ' ' then
nbx = nbx & x[i]
end if
end for
return nbx
end function
global function get_names()
-- convert the output from a plain dir command into a
-- sequence of file names
sequence file_names
object name
file_names = {}
while 1 do
name = gets(0)
if atom(name) then
exit
end if
if length(name) >= 12 then
if name[1] >= 'A' and name[1] <= 'Z' then
if not match("DIR", name[9..length(name)]) then
name = name[1..12]
name[9] = '.'
file_names = append(file_names, no_blanks(name))
end if
end if
end if
end while
return file_names
end function