+Wed Mar 10 23:25:13 2004 Ben Pfaff <blp@gnu.org>
+
+ Change explicit variable name checks into use of
+ dict_class_from_id().
+
+ * dictionary.c: (dict_create_var) Change explicit variable name
+ check into use of dict_class_from_id().
+
+ * get.c: (trim_dictionary) Ditto.
+
+ * sel-if.c: (cmd_filter) Ditto.
+
+ * sysfile-info.c: (cmd_display) Ditto.
+
+ * vars-prs.c: (parse_DATA_LIST_vars) Ditto.
+
+ * vfm.c: (arrange_compaction) Ditto.
+
+ * weight.c: (cmd_weight) Ditto.
+
Wed Mar 10 21:16:34 2004 Ben Pfaff <blp@gnu.org>
* temporary.c: (cmd_temporary) When TEMPORARY was the first
v->fv = d->next_value_idx;
v->nv = width == 0 ? 1 : DIV_RND_UP (width, 8);
v->init = 1;
- v->reinit = name[0] != '#';
+ v->reinit = dict_class_from_id (name) != DC_SCRATCH;
v->miss_type = MISSING_NONE;
if (v->type == NUMERIC)
{
v = xmalloc (sizeof *v * dict_get_var_cnt (dict));
nv = 0;
for (i = 0; i < dict_get_var_cnt (dict); i++)
- if (dict_get_var (dict, i)->name[0] == '#')
+ if (dict_class_from_id (dict_get_var (dict, i)->name) == DC_SCRATCH)
v[nv++] = dict_get_var (dict, i);
dict_delete_vars (dict, v, nv);
free (v);
return CMD_FAILURE;
}
- if (v->name[0] == '#')
+ if (dict_class_from_id (v->name) == DC_SCRATCH)
{
msg (SE, _("The filter variable may not be scratch."));
return CMD_FAILURE;
{
int i, m;
for (i = 0, m = n; i < n; i++)
- if (vl[i]->name[0] != '#')
+ if (dict_class_from_id (vl[i]->name) != DC_SCRATCH)
{
vl[i] = NULL;
m--;
lex_error ("expecting variable name");
goto fail;
}
- if (tokid[0] == '#' && (pv_opts & PV_NO_SCRATCH))
+ if (dict_class_from_id (tokid) == DC_SCRATCH
+ && (pv_opts & PV_NO_SCRATCH))
{
msg (SE, _("Scratch variables not allowed here."));
goto fail;
{
struct variable *v = dict_get_var (temp_dict, i);
- if (v->name[0] != '#')
+ if (dict_class_from_id (v->name) != DC_SCRATCH)
{
assert (v->nv > 0);
count_values += v->nv;
{
struct variable *v = dict_get_var (default_dict, i);
- if (v->name[0] == '#')
+ if (dict_class_from_id (v->name) == DC_SCRATCH)
continue;
if (v->type == NUMERIC)
{
struct variable *v = dict_get_var (default_dict, i);
- if (v->name[0] == '#')
+ if (dict_class_from_id (v->name) == DC_SCRATCH)
dict_delete_var (default_dict, v);
else
i++;
msg (SE, _("The weighting variable must be numeric."));
return CMD_FAILURE;
}
- if (v->name[0] == '#')
+ if (dict_class_from_id (v->name) == DC_SCRATCH)
{
msg (SE, _("The weighting variable may not be scratch."));
return CMD_FAILURE;