Logo

Hacker’s Guide to Visual FoxPro
An irreverent look at how Visual FoxPro really works. Tells you the inside scoop on every command, function, property, event and method of Visual FoxPro.

ServerName

This property stores the name of the program used to start the current application. This can be handy for determining the pathing needed to reach other components.

Usage

cServerName = appObject.ServerName

When starting your COM server as either a DLL or an EXE, its HOME() and SYS(2004) values might not give you the information you need. For an EXE, those functions often point at the Windows System directory. For a DLL, they point to the same settings as the application in which the DLL is running, since they share the same space. To know the location of the file that was started, and hence more easily find local resources it might need, such as an INI file or a resource file, test ServerName. This returns a full path and filename of the file that started the current Application Object.

Example

? _VFP.ServerName  && in development, returns the path to VFP

See Also

Application, Server, _VFP