FILE_FIND_FIRST$

FILE_FIND_FIRST$

RETURNS THE NAME OF THE FIRST FILE OF THE CURRENT DIRECTORY

  • Type: System Variable
  • Parameter: 0
  • Group: Files

ACTION

The system variable FILE_FIND_FIRST$ returns the name of the first file found in the current directory, or the character underscore "_" if the current directory does not contain a file.

Remark: the keyword FILE_FIND_FIRST$ ends by '$' because its value is a string.

FILE_FIND_FIRST$ is mandatory to know the names of the next files of the current directory by the keyword FILE_FIND_NEXT$.

As a resource to find the file names is open, after using FILE_FIND_FIRST$ or FILE_FIND_NEXT$, The resource must be closed with the keyword FILE_FIND_CLOSE.

SYNTAX: FILE_FIND_FIRST$ in an expression

USE

  • The system variable FILE_FIND_FIRST$ is used to know the name of the first file of a directory.

ERROR

  • If FILE_FIND_FIRST$ has not been used first.

EXAMPLE

dim a$

print "content of the current directory :":print

print file_find_first$

a$=file_find_next$

while a$<>"_"

print a$

a$=file_find_next$

end_while

file_find_close

SEE ALSO

FILE_FIND_NEXT$

FILE_FIND_CLOSE