[GRASS-user] return value of modules?
Rainer M Krug
r.m.krug at gmail.com
Fri Sep 19 06:25:33 EDT 2008
On Fri, Sep 19, 2008 at 11:42 AM, Hamish <hamish_b at yahoo.com> wrote:
> Rainer Krug wrote:
>> do the modules of R (e.g. r.stats, ...) have return values
>> which I can evaluate to find out if the execution was successful?
> Yes. GRASS modules all return 0 on success and 1 on failure.
Good to know - thanks as lot
>> I would like to use these "return values on error" to evaluate the
>> success of the command when called from R.
> In most cases you can trust that method. Maybe 1% of modules use a
> different failure code, if so it's a bug & please report it.
> Some/many of the internal C functions will use 1 as success, but they
> will typically be called G_is_something() and return a boolean result.
> The lib fns return all sorts of things, always check before using them.
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
Biology, UCT), Dipl. Phys. (Germany)
Centre of Excellence for Invasion Biology
Faculty of Science
Natural Sciences Building
Private Bag X1
University of Stellenbosch
More information about the grass-user