************************************************************************ FUNCTION GetAppStartPath ********************************* *** Function: Returns the FoxPro start path *** of the *APPLICATION* *** under all startmodes supported by VFP. *** Returns the path of the starting EXE, *** DLL, APP, PRG/FXP *** Return: Path including drive letter\UNC network path ************************************************************************ DO CASE *** VFP 6 and later provides ServerName property for COM servers EXE/DLL/MTDLL CASE INLIST(_VFP.StartMode,2,3,5) lcPath = JustPath(_VFP.ServerName) *** Interactive CASE (_VFP.StartMode) = 0 lcPath = SYS(5) + CURDIR() *** Active Document CASE ATC(".APP",SYS(16,0)) > 0 lcPath = JustPath(SYS(16,0)) *** Standalone EXE or VFP Development OTHERWISE lcPath = JustPath(SYS(16,0)) IF ATC("PROCEDURE",lcPath) > 0 lcPath = SUBSTR(lcPath,RAT(":",lcPath)-1) ENDIF ENDCASE RETURN AddBs(lcPath) * EOF GetAppStartPath>Hi Gang!