Page 1 of 1

working storage dictionary with item groups

Posted: May 1st, 2019, 9:37 am
by AriSilva
Hi folks,
I have a working storage dictionary to store some data from the questionnaires.
One of the fields is a group item (string 57), with subitems as string and numeric.
When loading the data to the group item, and immediately looking at the subfields, the string ones are perfect, but it seems that the numeric ones were not valued.
The real values are only "loaded" into the numeric fields if, after finishing loading the questionnaires, I issue a sort statement. Then the numeric fields can be accessed.
Best
Ari

Re: working storage dictionary with item groups

Posted: May 1st, 2019, 11:01 am
by Gregory Martin
If you want, you can send us an application where this happens and we can take a look. I think I've observed the behavior that I think you're describing. Under the hood, CSPro stores numerics in two ways, one being the actual numeric value, and the other being the string representation of that value. With strings, there is only one representation. My guess is that when you're assigning something to the parent item, the subitem's numeric value isn't being updated. You could test this by seeing what the value for getbuffer(NUMERIC_SUBITEM) returns. My guess is that this would return the correct value (as a string value).

In summary, items/subitems work pretty well in data entry, and even in batch when you're not modifying them, but I do believe that there may be issues with numeric subitems being updated when you modify the parent item.