CALL FILES
This page was last modified 19:21, 26 May 2023 by Mars2000you. Based on work by Gdx.

This instruction is available in DM-System2 Basic and RMSX Basic.

Contents

CALL FILES in DM-System2 Basic

Effect

Gets file names to the work area of DM-System 2 (at address 7A00h), the resulting file names will be placed one after the other every 12 bytes. Use the instructions CALL PEEKS and CALL BLOCK to recover them easily and quickly.

Syntax

CALL FILES ("<Device>:\<Path>\<Filename>",<Variable>)

Notes:

  • Character backslash (\) serves as a separator between the folders and the file name in MSX-DOS2. You don't have to put it after the colon of the device name.
  • Character backslash is replaced by the character yen (¥) on Japanese MSX or the character won (₩) on Korean MSX.
  • Parameters can not end with a comma alone.

Parameters

<Device> is the name for used device (see table below).

If you don't specify the device, the computer will display the file(s) of the currently active drive (by default, it's generally drive A:)

Device type Device name Remark
Disk drive A, B, C, D, E, F, G, H A floppy disk interface can control until 2 drives.
Linked computer COM Requires RS-232C interface


<Path> is used to specify the location in folders of file to load. Each folder name in path are separate by a backslash (\). This parameter is only available in version 2 of Disk BASIC.

<Filename> is the file name to search. Wildcards can replace some characters in filename to get several files. The asterisk (*) and question mark (?) are used as wildcard characters. The asterisk matches any sequence of characters, whereas the question mark matches any single character.

<Variable> must be a numerical variable that will receive the number of resulting file names.

Related to

CALL CHGDRV, CALL FSIZE, CALL LOAD, CALL SAVE

Compatibility

DM-System2 BASIC


CALL FILES in RMSX Basic

Effect

Lists the contents of a real disk in a drive of the MSX turbo R, used as host for a MSX1/MSX2 computer emulated on this machine with the rMSX emulator.

The disk can be a floppy disk, hard disk, CD, CF or similar device. If you are using version 2 of Disk BASIC, CALL FILES will list the contents of the current directory in a drive (files and subdirectories).

Note: It's very similar to FILES, but can also be used when you have started rMSX with the NODISK parameter or when you have booted the MSX1 or MSX2 computer emulated by rMSX while pressing the SHIFT key to get maximum free memory for running games on tape image (CAS file).

Syntax

CALL FILES ("<Device>:\<path>\<Filename>")]

Notes:

  • Character backslash (\) serves as a separator between the folders and the file name in MSX-DOS2. You don't have to put it after the colon of the device name.
  • Character backslash is replaced by the character yen (¥) on Japanese MSX or the character won (₩) on Korean MSX.

Parameters

<Device> is the name for used device (see table below).

If you don't specify the device, the computer will display the file(s) of the currently active drive (by default, it's generally drive A:)

Device type Device name Remark
Disk drive A, B, C, D, E, F, G, H A floppy disk interface can control until 2 drives.


<Path> is used to specify the location in folders of file to load. Each folder name in path are separate by a backslash (\). This parameter is only available in version 2 of Disk BASIC.

<Filename> is the file name to search. Wildcards can replace some characters in filename to get several files. The asterisk (*) and question mark (?) are used as wildcard characters. The asterisk matches any sequence of characters, whereas the question mark matches any single character.

Examples

_FILES ("B:")  'Show all files on drive B: (it must be an existing drive)
 
_FILES ("M*.*") 'Show all files with a name beginning with character M
 
_FILES ("*.CAS") 'Show all files with the extension ".CAS" 
 
_FILES ("*.*") 'Show all the files (same effect as _FILES without any pattern)

Disk Basic 2.0 has support for sub-directories.

Dot (.) represents the current working directory, Dot Dot (..) represents the directory before the current (one level up).

_FILES ("\GAMES\")  'Shows the contents of the \GAMES\ directory 
<.>
<..>
GAME.DSK
Ok

Related to

CALL CASRUN, CALL CHCAS, CALL CHDIR, CALL CHDSK, FILES

Compatibility

RMSX BASIC