forked from gvegayon/devtools
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
George Vega
committed
Apr 10, 2014
1 parent
700e590
commit 568f053
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |