Anonymous user
Walk a directory/Recursively: Difference between revisions
m
→{{header|REXX}}: reinstated original program; changed/added comments, added an example output.
m (→{{header|REXX}}: elided redundant REXX word in the REXX version titles for REXX.) |
m (→{{header|REXX}}: reinstated original program; changed/added comments, added an example output.) |
||
Line 1,601:
{{works with|Regina}}
The following program was tested in a DOS window under Windows/XP and should work for all Microsoft Windows.
<lang rexx>/*REXX program shows all files in a
parse arg xdir; if xdir='' then xdir='\'
@.=0 /*default result in case ADDRESS fails.
address system
▲if rc\==0 then do /*an error happened?*/
if rc\==0 then do
say '
if #==0 then #=' no ' /*use a better word choice for 0 (zero)*/
say center('directory ' xdir " has " # ' matching entries.', 79,
do j=1 for #; say @.j
end /*j*/
exit @.0+rc /*stick a fork in it, we're all done. */</lang>
'''output''' when the following was used: <tt> I:\firefox*.exe </tt>
<pre>
─────────────directory I:\firefox*.exe has 6 matching entries.─────────────
I:\FIREFOX\firefox.exe
I:\FIREFOX\INSTALL\Firefox Setup 1.5.0.1.exe
I:\FIREFOX\INSTALL\Firefox Setup 2.0.0.4.exe
I:\FIREFOX\INSTALL\Firefox Setup 3.0.4.exe
I:\FIREFOX\INSTALL\Firefox Setup 3.6 Beta 5.exe
I:\FIREFOX\INSTALL\Firefox Setup 4.0 Beta 11.exe
</pre>
===version 2===
|