>>FUNCTION GetInfo(tlUseBR as Logical) as string >> >> local lcText, lcConfigText, oErr as Exception, ; >> lIsInMTS, oContext, cErr, oMTX, lcCommandLine, ; >> laServerVers[1], laServerInfo[1], lcServerType >> >> cErr = "" >> lcText = "" >> lcServerType = "" >> >> * Determine startmode >> do case >> case _vfp.StartMode=0 >> lcServerType='VFP IDE' >> case _vfp.StartMode=1 >> lcServerType='VFP Automation Server' >> case _vfp.StartMode=2 >> lcServerType='Out of Proc EXE' >> case _vfp.StartMode=3 >> lcServerType='InProc DLL' >> case _vfp.StartMode=5 >> lcServerType='InProc MTDLL' >> endcase >> >> * Find out whether in COM+/MTS >> oContext = NULL >> try >> oMTX = CREATEOBJECT("MTXAS.APPSERVER.1") >> * returns NULL if not in COM+ or MTS >> oContext = oMTX.GetObjectContext() >> catch to oErr >> cErr = oErr.Message >> finally >> lIsInMTS = !IsNull(oContext) >> release oMTX, oContext >> endtry >> >> * Do we have a config file? (works in VFP9 only) >> lcConfigText = "" >> >> if !empty(Sys(2019,2)) >> lcConfigText= CRLF +"* Config File Contents:" ; >> + CRLF + FileToStr(Sys(2019,2)) + CRLF + ; >> "* End of config file"+ CRLF >> endif >> >> * Get Command Line >> DECLARE INTEGER GetCommandLine IN kernel32 >> >> lcCommandLine = Sys(2600,GetCommandLine(),255) >> >> clear dlls GetCommandLine >> >> * Drop trailing nulls >> lcCommandLine = Substr(lcCommandLine, 1, At(Chr(0), lcCommandLine,1)-1) >> >> * Get version info for server: >> =AGetFileVersion(laServerVers,_vfp.ServerName) >> >> =ADir(laServerInfo,_vfp.ServerName) >> >>* get remainder of settings, output them >> >>TEXT to lcText noshow textmerge >>Date/time of run: <<Datetime()>> >>ServerName: <<_vfp.servername>> >>ServerVersion: <<Iif(Type('laServerVers[4]')='U','None',laServerVers[4])>> >>ServerDateTime: <<Dtoc(laServerInfo[1,3])+ ' ' + laServerInfo[1,4]>> >>DefaultDir: <<_vfp.DefaultFilePath>> >>CommandLine: <<lcCommandLine>> >>Is In COM+: <<Iif(Empty(cErr),Iif(lIsInMTS,"Yes","No"),cErr)>> >>ProcessID: <<_vfp.ProcessID>> >>ThreadID: <<_vfp.ThreadID>> >>RuntimeDLL: <<_vfp.FullName>> >>VFP Version: <<Version()>> >>StartMode: <<lcServerType>> >>MachineName: <<GetWordNum(Sys(0),1)>> >>UserName: <<GetWordNum(Sys(0),3)>> >> >>SET RESOURCE is: <<Set("Resource")>> >>Resource file is: <<Iif(!Empty(sys(2005)),sys(2005),"None")>> >>Config File is: <<Iif(!Empty(Sys(2019,2)),Sys(2019,2),"None")>> >><<lcConfigText>> >>VFP SET PATH: <<Set("Path")>> >>VFP Temp Path: <<Sys(2023)>> >> >>OS Path: <<GetEnv("Path")>> >>OS TEMP Path: <<GetEnv("temp")>> >>OS TMP Path: <<GetEnv("tmp")>> >> >>SET SYSFORMATS: <<set('sysformats')>> >>SET CENTURY: <<set('Century')>> >>SET DATE: <<set('Date')>> >>SET DECIMALS: <<set('decimals')>> >>SET HOURS: <<set('hours')>> >>SET MARK: <<set('mark')>> >>SET POINT: <<set('point')>> >>SET SEPARATOR: <<set('separator')>> >>SET ENGINEBEHAVIOR: <<set('enginebehavior')>> >>SET REFRESH 1: <<set('refresh')>> >>SET REFRESH 2: <<set('refresh',1)>> >> >>Foreground 3050: <<Transform(val(sys(3050,1)),'@R 999,999,999,999')>> >>Background 3050: <<Transform(val(sys(3050,2)),'@R 999,999,999,999')>> >>endtext >> return Iif(tlUseBR,Strtran(lcText, Chr(13)+Chr(10), '<BR>'),lcText) >> ENDFUNC >>>>