*! 3nov2010 program recent version 11.1 mata: DoIt() end version 11.1 mata: void DoIt() { //>>def func<< class prefs scalar pr syntaxl(st_local("0"),NULL, (&(dirs="[d:irectories]"),&(ud="[u:sed]"),&(sd="[s:aved]"),&(cd="[c:ollected]"),&(md="[m:erged]"))) all=dirs+ud+sd+cd+md==0 if (md|all) { pr.make("recentmerged","path") if (strlen(pr.body[1])) { //need something for links to go without error x=pathparts(pr.body,"1,23") x[,1]=J(rows(x),1,char(1)+`"00stata "cdl "'):+x[,1]:+J(rows(x),1,char((34,2))):+x[,1]:+J(rows(x),1,char(3)) x[,2]=J(rows(x),1,char(1)+`"00stata "usel "'):+pr.body:+J(rows(x),1,char((34,2))):+x[,2]:+J(rows(x),1,char(3)) x=("Merged","")\x x=subinstr(x,"\","/") //backslashes can cause problems with display (eg, \n) t=table_createM(x) asarray(t,"head",1) table_code(t,"span","cell",(1,1),2) table_code(t,"align","cell",(1,1),"<") table_code(t,"vline","c",1,"thick") printf("\n") table_present(t) } } if (cd|all) { pr.make("recentcollected","path") if (strlen(pr.body[1])) { //need something for links to go without error x=pathparts(pr.body,"1,23") x[,1]=J(rows(x),1,char(1)+`"00stata "cdl "'):+x[,1]:+J(rows(x),1,char((34,2))):+x[,1]:+J(rows(x),1,char(3)) x[,2]=J(rows(x),1,char(1)+`"00stata "usel "'):+pr.body:+J(rows(x),1,char((34,2))):+x[,2]:+J(rows(x),1,char(3)) x=("Collected","")\x x=subinstr(x,"\","/") //backslashes can cause problems with display (eg, \n) t=table_createM(x) asarray(t,"head",1) table_code(t,"span","cell",(1,1),2) table_code(t,"align","cell",(1,1),"<") table_code(t,"vline","c",1,"thick") printf("\n") table_present(t) } } if (dirs|all) { pr.make("recentdirs","path") if (strlen(pr.body[1])) { //need something for links to go without error x=J(rows(pr.body),1,char(1)+`"00stata "cdl "'):+pr.body:+J(pr.r,1,char((34,2))):+pr.body:+J(pr.r,1,char(3)) x=("Directories")\x x=subinstr(x,"\","/") //backslashes can cause problems with display (eg, \n) t=table_createM(x) table_code(t,"align","t",.,"<") asarray(t,"head",1) printf("\n") table_present(t) } } if (ud|sd|all) { pr.make("recentfiles","path") if (strlen(pr.body[1])) { //need something for links to go without error x=pathparts(pr.body,"1,23") x[,1]=J(rows(x),1,char(1)+`"00stata "cdl "'):+x[,1]:+J(rows(x),1,char((34,2))):+x[,1]:+J(rows(x),1,char(3)) x[,2]=J(rows(x),1,char(1)+`"00stata "usel "'):+pr.body:+J(rows(x),1,char((34,2))):+x[,2]:+J(rows(x),1,char(3)) x=("Used & Saved","")\x x=subinstr(x,"\","/") //backslashes can cause problems with display (eg, \n) t=table_createM(x) asarray(t,"head",1) table_code(t,"span","cell",(1,1),2) table_code(t,"align","cell",(1,1),"<") table_code(t,"vline","c",1,"thick") printf("\n") table_present(t) } } } end