FILE_NAME$()

FILE_NAME$(N)

RETURNS THE FILE NAME GIVEN BY THE SYSTEM OBJECT NUMBER N

  • Type: Function
  • Parameter: 1
  • Group: System Objects

ACTION

The function FILE_NAME$(N) returns the file name chosen by the user who handles an object of type OPEN_DIALOG, SAVE_DIALOG, OPEN_DIALOG_PIC, SAVE_DIALOG_PIC.

The function makes the object visible and the program is suspended until the user chooses a file name or cancels the operation.

N is the number of an object of type : OPEN_DIALOG, SAVE_DIALOG, OPEN_DIALOG_PIC, SAVE_DIALOG_PIC.

Remark 1: if the user clicks on the button "cancel" of the object, the function FILE_NAME$ returns the character underscore "_" as file name.

Remark 2: the keyword FILE_NAME$ ends by '$' because the returned value is a string.

SYNTAX: Result$=FILE_NAME$(N)

  • N = system object number (integer or real). Must be greater than 0 and less than or equal to the allowed maximum number of system objects.
  • Result$ is a string (file name chosen by user or character underscore "_" is no file is chosen)

USE

  • The function FILE_NAME$() is used to open a file with an OPEN_DIALOG, OPEN_DIALOG_PIC or to save a file with a SAVE_DIALOG, SAVE_DIALOG_PIC.

ERROR

  • If number N is not a correct expression.
  • If number N exceeds the allowed maximum number of system objects.
  • If number N is not greater than 0.
  • If the system object number N does not exist.
  • If system object number N is not of the type : OPEN_DIALOG, SAVE_DIALOG, OPEN_DIALOG_PIC, SAVE_DIALOG_PIC.

EXAMPLE

rem create an OPEN_DIALOG

open_dialog 1

rem create a LIST

list 2

rem fill it with the file chosen by the user (open_dialog)

file_load 2,file_name$(1)

SEE ALSO

OPEN_DIALOG

SAVE_DIALOG

OPEN_DIALOG_PIC

SAVE_DIALOG_PIC

FILE_DIALOG

FILTER

DIR_DIALOG