add new test stringstyle() for identify variable styles that return stored strings directly
This commit is contained in:
@ -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,
|
||||
|
||||
@ -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);
|
||||
|
||||
Reference in New Issue
Block a user