Skip to content

Commit

Permalink
Adding new files (demo)
Browse files Browse the repository at this point in the history
  • Loading branch information
George Vega committed Apr 10, 2014
1 parent 700e590 commit 568f053
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
30 changes: 30 additions & 0 deletions demo.ado
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
program define demo
syntax anything(name=which) [, list *]

local cmd = word(`"`which'"', 1)
local ext = substr(`"`which'"', strlen(`"`cmd'"') + 1, .)

mata: st_local("filepath", findfile(`"`cmd'_demo.ado"'))

if ("`filepath'" == "") {
noi di as error `"-demo `cmd'- requires file `cmd'_demo.ado, which is not found"'
exit 601
}

noi di ""
if ("`list'" == "") {
noi di "{txt}{hline 2} begin demo {hline}"
}
noi di ""
capture noi `cmd'_demo `ext' , `list' `options'
noi di ""
if ("`list'" == "") {
noi di "{txt}{hline 2} end demo {hline}"
}
noi di ""

if (_rc) {
noi di as error `"error while running `cmd'_demo"'
exit _rc
}
end
7 changes: 7 additions & 0 deletions dt_txt_split_demo.ado
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
program define dt_txt_split_demo
noi di " > this could be an extended demo for dt_txt_split"
noi di `"mata: dt_txt_split("Hola joe, como estais",8,2)"'
noi mata: dt_txt_split("Hola joe, como estais",8,2)
noi di ""
noi di " > etc ..."
end

0 comments on commit 568f053

Please sign in to comment.