FILE_EXTRACT_DISK$()

FILE_EXTRACT_DISK$(F)

RETURNS A DISK NAME FROM F

  • Type: Function
  • Parameter: 1
  • Group: Files

ACTION

The function FILE_EXTRACT_DISK$(F) returns a disk name as letter (C: or D: or ...) from the expression F.

The result is meaningfull when F is an absolute name.

If there is no disk name in the expression F, an empty string is returned.

SYNTAX: Result$=FILE_EXTRACT_DISK$(F)

  • F = name of file.
  • Result$ is a string.

USE

  • The function FILE_EXTRACT_DISK$() is used to extract a disk name from a string.

ERROR

  • If F is not a correct name of file.

EXAMPLE

rem create an open_dialog to point a file

open_dialog 1

rem display as window title the disk containing the chosen file

caption 0,file_extract_disk$(file_name$(1))

SEE ALSO

FILE_EXTRACT_EXTENSION$(F)

FILE_EXTRACT_NAME$(F)

FILE_EXTRACT_PATH$(F)