Skip to main content
Version: Next

Application file

Application file -> Function result

ParameterTypeDescription
Function resultString🡐Long name of the 4D executable file or application

Description

The Application file command returns the long name of the 4D executable file or application you are running.

On Windows
If, for example, you are running 4D located at \PROGRAMS\4D on the volume E, the command returns E:\PROGRAMS\4D\4D.EXE.

On Macintosh
If, for example, you are running 4D in the Programs folder on the disk Macintosh HD, the command returns Macintosh HD:Programs:4D.app.

Example

At startup on Windows, you need to check if a DLL Library is correctly located at the same level as the 4D executable file. In the of your application you can write:

 If(Is Windows&(Application type#4D Server))
    var $appPath : Object
    $appPath:=Path to object(Application file)
    If(Test path name(($appPath.parentFolder)+"XRAYCAPT.DLL")#Is a document)
       ALERT("XRAYCAPT.DLL is missing. The X-ray capture capability will not be available.")
    End if
 End if

See also

Data file
Structure file