{smcl} {bf:Mata course: Two Matas} {hline} {title:There are two -mata- commands} 1. . {cmd:mata} {c TLC}{c -}{c TRC} 2. . {cmd:mata}{c |}{cmd::}{c |} {c BLC}{c -}{c BRC} {it:(notice the colon)} {title:What's the difference?} {com}. mata {txt}{hline 29} mata (type {cmd:end} to exit) {hline 3} {com}: make a mistake {err}invalid expression {txt}{search r(3000):r(3000);} {com}: {txt}{it:(We are still in Mata)} {com}: end {txt}{hline 58} and {com}. mata: {txt}{hline 29} mata (type {cmd:end} to exit) {hline 3} {com}: make a mistake {err}invalid expression {txt}{hline 58} {search r(3000):r(3000);} {com}. {txt}{it:(We are back to Stata)} {p 4 4 2} Recommendation: 1. Use {cmd:mata} interactively {c TLC}{c -}{c TRC} 2. Use {cmd:mata}{c |}{cmd::}{c |} in ado-files and do-files {c BLC}{c -}{c BRC} {hline} {bf:{view talk.smcl:Top}}