*# non # Display characters & ascii values *! 3jun2009 program ascii version 10.1 syntax , [Letters Control Other] if mi("`letters'`control'`other'") mata:doAscii(1,0,0) else mata: doAscii(`=!mi("`other'")',`=!mi("`letters'")',`=!mi("`control'")') end version 10.1 mata: void doAscii(o,l,c) { chars=columnize(cat(findfile("ascii_latin1.txt")),char(9)) controls=toindices(chars[,2]:=="control") chars=chars(0::255),strofreal(0::255)/*,inbase(16,0::255)*/,chars chars[controls,1]=J(rows(controls),1,char(26)) if (o) show(select(chars[,1..3],chars[,4]:=="other")) if (c) show(select(chars[,2..3],chars[,4]:=="control")) if (l) { sl=select(chars[,1..3],chars[,4]:=="small") cl=select(chars,chars[,4]:=="capital") show(pad(cl[,1..2],(sl[vvmap(cl[,3],sl[,3],1),]\sl[toindices(!vvmap(cl[,3],sl[,3],2)),]),",")) } } end