DIR$

command

Iterate over directory entries.

entry$ = DIR$(spec$ [, filter$]) entry$ = DIR$(“”)

spec$ - path, wildcard or exact filename; starts a new listing filter$ - “DIR”, “FILE” or “ALL” (default); the barewords DIR, FILE

and ALL are also accepted

DIR$(“”)- returns the next entry of the current listing, or “” at the end

An exact filename is allowed, so DIR$(“name.ext”, FILE) <> “” tests whether the file exists.

See also DIR.

Example:

DO
  f$ = DIR$("A:/*.BAS")
  IF f$ = "" THEN EXIT DO
  PRINT f$
LOOP

Source: docs/help/dir-dollar.txt inmmcore. On the computer, typeHELP DIR$.