I've made a package to estimate a model by maximum likelihood. I'd like to store a result as e(converged), as many inbuilt commands do, which contains 1 if convergence was achieved, 0 otherwise.

I know the simple part - let's say I have a local macro converged containing 0 or 1 accordingly, then I would add

Code:
ereturn scalar converged = `converged'
But my question is, what is the best way to set the contents of the local macro converged ? I'd like to follow the method used in inbuilt commands if possible.