*! _gdxischeck2 0.2.1 2008-01-27
*   > minor cleanup

//  check if gdxis has been run and necessary globals created.
//  return r(error) with error codes if globals are not found.

capture program drop _gdxischeck2

program define _gdxischeck2, rclass
    version 9

//  CHECK IF GLOBALS ARE DEFINED

    local error = 0
    foreach n in xis xisg0 xisg1 xismn0 xismn1 xisg0mn0 xisg1mn1 {
        if "$`n'"=="" {
            local error = 1
            di in red "\$`n' is not defined."
        }
    }
    if `error' {
        di in red "You need to run gdxis."
    }

    return local error = `error'

end
exit

//  History

* _gdxischeck1 0.1.1 2007-03-11
* _gdxischeck2 0.2.0 2007-03-22