Jason Stover <[email protected]> writes: > Question: > > /* Create a variable to be used for internal calculations only */ > struct variable * > var_create_internal (int case_idx) > { > struct variable *v = var_create ("$internal", 0); > > struct vardict_info vdi; > > vdi.dict = NULL; > vdi.dict_index = 0; > vdi.case_index = case_idx; > > var_set_vardict (v, &vdi); > > return v; > } > > /* Dictionary data stored in variable. */ > struct vardict_info > { > int dict_index; /* Dictionary index containing the variable. */ > int case_index; /* Index into case of variable data. */ > struct dictionary *dict; /* The dictionary containing the variable */ > }; > > What is the "case of variable data"? All the examples I see in > src/language/stats show a value of either 0, 1 or 2.
Wrong operator precedence here I think: it's an index into a case, and a case contains variable data. To elaborate: A case consists of an array of values. The index into such an array is called a case_index (or case_idx). If you create your own cases with N values per case, then you assign them case_idx values from 0 to N-1. -- Ben Pfaff http://benpfaff.org _______________________________________________ pspp-dev mailing list [email protected] http://lists.gnu.org/mailman/listinfo/pspp-dev
