Gets the name of an ASCII or binary file.
Name := File.NAME
- Type: File Use this variable to refer the file.
Property Value/Return Value
Type: Text or Code
This string contains the name of the file, including its path.
You must use the OPEN Function (File) to open the file before you can use this function.
The following example opens a text file that is named C:\TestFolder\TestFile.txt. The NAME Function (File) retrieves the name and path of the text file and stores it in the varName variable. The value in the variable is displayed in a message box. This example assumes that you have created a text file named C:\TestFolder\TestFile.txt. This example requires that you create the following variables in the C/AL Globals window.
TestFile.OPEN('C:\TestFolder\TestFile.txt'); varName := TestFile.NAME; MESSAGE('The name of the file is: %1',varName);