Description for SYS(16) includes this:
SYS(16) is similar to PROGRAM( ) except that SYS(16) returns a path with the program name. When the executing program is part of an application (.app), SYS(16) returns only the name of the program, that is, without the path. SYS(16) returns the name of the executable file if called from an executable (.exe) file; whereas PROGRAM( ) returns just the program name. If a procedure or function is being executed, SYS(16) returns the name of the file containing the procedure or function after the procedure or function name.
The statement 'When the executing program is part of an application (.app), SYS(16) returns only the name of the program, that is, without the path.' is somewhat misleading. The full name, including the path, is in fact returned for the APP file, even if it is not returned for any of the programs executing within the APP.
SYS(16) is similar to PROGRAM( ) except that SYS(16) returns a path with the program name. When the executing program is part of an application (.app), SYS(16) returns only the name of the program, that is, without the path. SYS(16) returns the name of the executable file if called from an executable (.exe) file; whereas PROGRAM( ) returns just the program name. If a procedure or function is being executed, SYS(16) returns the name of the file containing the procedure or function after the procedure or function name.
The statement 'When the executing program is part of an application (.app), SYS(16) returns only the name of the program, that is, without the path.' is somewhat misleading. The full name, including the path, is in fact returned for the APP file, even if it is not returned for any of the programs executing within the APP.