*! gc_checksetup 0.5.1 2009-05-25 jsl

//  check if gcsetup has been run and necessary variables are set

capture program drop gc_checksetup
program define gc_checksetup, rclass
    version 9

    local error = 0
    foreach g in grpvar gr1var gr0var {
        if "$`g'"=="" {
            local error = 1
            di in red "\$`g' is not defined."
        }
    }
    if `error' {
        di in red "You need to run gcsetup."
    }

    return local error = `error'

end
exit

* _gdsetcheck3 0.3.0 2008-04-10 > No changes.
* _gcsetcheck 0.1.1 2008-06-24 revise global names
* _gcsetcheck 0.1.0 2008-06-18
* _gcsetcheck 0.5.0 2009-05-22 jsl