FILES

From QB64 Phoenix Edition Wiki
Jump to navigation Jump to search

The FILES statement is used to print a list of files in the current directory using a file specification.


Syntax

FILES [fileSpec$]


Description

  • fileSpec$ is a string expression or variable containing a path when required.
  • fileSpec$ can use the * and ? wildcard specifications:
    • * denotes one or more wildcard characters in a filename or path specification as any legal file name character(s).
    • ? denotes one wildcard letter in a filename or path specification as any legal filename character.
  • If fileSpec$ is omitted, it is assumed to be "*.*" (all files and folders in the current directory).
  • Illegal filename characters in QB64 include * > < : " | \ / with any amount of dot extensions being allowed in Windows.
  • FILES lists can make the screen roll up. Try using SHELL "DIR" with the /P option. DIR command.
  • To get individual directory entries use _FILES$ instead.


Examples

Example 1: Finding a list of all BAS files in the current folder.
FILES "*.BAS"


See also



Navigation:
Main Page with Articles and Tutorials
Keyword Reference - Alphabetical
Keyword Reference - By usage