Martin Landa wrote: > > The ->answer field in "struct Option" is a char*; it can only hold a > > string. Similarly, that's all that g.parser can pass to a script. It's > > up to the module or script to parse these to integers or floats where > > appropriate. > > would make sense to change it in GRASS 7, e.g. option->answer as > 'union' (int, double, char *).
opt->answer can also be a list of values when opt->multiple == TRUE. > In this regard also check given value > by the parser. Then the parser could print a warning when the user > enter option value which cannot be casted to the given data type (e.g. > string for integer option). It already does this; see check_an_opt() in parser.c. -- Glynn Clements <[email protected]> _______________________________________________ grass-dev mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/grass-dev
