add new test stringstyle() for identify variable styles that return stored strings directly

This commit is contained in:
Axel Kohlmeyer
2016-08-23 18:25:52 -04:00
parent bddb31ea43
commit bc0864e2d3
2 changed files with 14 additions and 0 deletions

View File

@ -804,6 +804,19 @@ int Variable::internalstyle(int ivar)
return 0;
}
/* ----------------------------------------------------------------------
return 1 if variable is INDEX or WORLD or STRING or SCALARFILE, 0 if not
this is used to discriminate between variables that return a pointer to
the stored string and others that do evaluations or return numbers.
------------------------------------------------------------------------- */
int Variable::stringstyle(int ivar)
{
if (style[ivar] == INDEX || style[ivar] == WORLD
|| style[ivar] == STRING || style[ivar] == SCALARFILE) return 1;
return 0;
}
/* ----------------------------------------------------------------------
return ptr to the data text associated with a variable
if INDEX or WORLD or UNIVERSE or STRING or SCALARFILE,

View File

@ -38,6 +38,7 @@ class Variable : protected Pointers {
int vectorstyle(int);
char *pythonstyle(char *, char *);
int internalstyle(int);
int stringstyle(int);
char *retrieve(char *);
double compute_equal(int);