Prints the contents of a directory.
Dir path$ [To file$]
path$:sexp;
file$:sexp; optional file name
Dir path$ returns the directories in path name specified in path$. If path$ ends with a ":" or "\", GFA-BASIC automatically appends "*.*". The default destination for the output of the directory is to screen. The specification of To file$ is optional. It can be used to redirect the directory output to a file or a peripheral device.
OpenW 1
Local x%
Dir "c:\windows\?a.*" To "test.dat"
// if not exist a file will be created and therein all file
// names are placed in, which will be found by using the
// last pattern.
Dir "c:\windows\*.?st" To "test2.dat"
// or
Dir "c:\windows\*.lst" To "Test3.dat"
{Created by Sjouke Hamstra; Last updated: 24/08/2021 by James Gaite}