CurrentFile {*M}

Returns the selected filename.

Syntax:

CurrentFile ( )

Parameters:

(none)

Returns:

(s) currently-selected file's name.

 

When a WIL menu shell displays the files in the current directory, one of them may be "selected". This function returns the name of that file, if any.

This is different than a "highlighted" file. When a file is highlighted, it shows up in inverse video (usually white-on-black). To find the filenames that are highlighted, see FileItemize.

Note: This command is not part of the WIL Interpreter package, but is documented here because it has been implemented in many of the shell or file manager-type applications which use the WIL Interpreter. See FileMenu in the WinBatch Users Guide for details.

Example:
;The CurrentFile function is designed for menu based
;implementations of WIL, such as FileMenu. It is not
;supported in the WinBatch Product.
;Ask which program to show (default = current file)
;Edit Current File
thefile = AskLine("Show File", "Program:",CurrentFile( ), 0)
Run("browser.exe",thefile)

See Also:

CurrentPath, DirGet, DirItemize, FileItemize