** Loader procedure Loader() lparameters _p01,_p02,_p03,_p04,_p05,_p06,_p07,_p08,_p09,_p10,_p11,_p12,_p13, ; _p14,_p15,_p16,_p17,_p18,_p19,_p20,_p21,_p22,_p23,_p24,_p25,_p26,_p27 acti screen _screen.Fontname = 'Courier New' _screen.Fontsize = 10 set FullPath On local StartupApp, LocalApp, cmd, i, n n = pCount() StartupApp = addbs(justpath(StartUpExe()))+juststem(StartUpExe())+'.app' LocalApp = addbs(_vfp.DefaultFilePath)+juststem(StartUpExe())+'.app' cmd = 'do ("' + LocalApp + '")' for i = 1 to n cmd = cmd + iif(i=1, ' with ', ',') + '_p' + padl(ltrim(str(i,4,0)),2,'0') endfor for i = n+1 to 27 release ('_p'+padl(ltrim(str(i,4,0)),2,'0')) endfor do case case ( StartupApp == LocalApp ) && do nothing otherwise if( FileExists(StartupApp) ) && if outdated delete if( FileExists(LocalApp) ) if( fdate(StartupApp,1) > fdate(LocalApp,1) ) delete file (LocalApp) endif endif && if LocalApp not there copy if( !FileExists(LocalApp) ) copy file (StartupApp) to (localApp) endif endif endcase if( !FileExists(LocalApp) ) =MessageBox('Cannot find ' + LocalApp, 0+16, JustStem(LocalApp)) return endif release StartupApp, LocalApp, i, n &cmd endproc *---------------------------------------------------------------------------- function StartUpExe() do case case ( ':' $ sys(16,0) ) return substr(sys(16,0), rat(':', sys(16,0))-1) otherwise return substr(sys(16,0), rat('\\', sys(16,0))) endcase endfunc *---------------------------------------------------------------------------- Function FileExists(FileName) declare Integer GetFileAttributes in win32api string @ return (GetFileAttributes(@FileName) <> -1) endfunc *--------------------------------------------------------------------------