*! v0.2.0 2018-08-05 Scott Long

//  browseit.ado: list dta files in working directory; click to browse
//  jslong@iu.edu - Scott Long

program define browseit
    version 13.0
    syntax [ anything]

    local filespec : subinstr local anything ".dta" "", all
    if "`filespec'"=="" local filespec "*"
    local filelist : dir "`c(pwd)'" files "`filespec'.dta"

    foreach file in `filelist' {
        display `"{stata _usebrowse `file':`file'}"'
    }

end
exit