name()

Read(295) Label: main directory, path,

Here’s how to use name() function.

f .name()

Description:

Return a file’s path relative to the main directory.

Syntax:

f.name()

Note:

The function returns file f’s path relative to the main directory; return the full path if f isn’t in the main directory.

Parameters:

f

A file

Options:

  @p  Return a full path

Return value:

String

Example:

 

A

 

1

=file("G:/Program files/raqsoft/esProc/demo/data/data.txt").name()

Return the path which is relative to the main directory because the file is under the main directory: G:/Program files/raqsoft/esProc/demo

2

=file("E:/Program files/raqsoft/esProc/data/data.txt").name()

Return the full path when the file isn’t in the main directory

3

=file("employee1.txt").name@p()

Return the full path since employee1.txt is in the main directory