working storage dictionary with item groups

Other discussions about CSPro
Posts: 246
Joined: July 22nd, 2016, 3:55 pm

working storage dictionary with item groups

Postby AriSilva » May 1st, 2019, 9:37 am

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.

Gregory Martin
Posts: 1204
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: working storage dictionary with item groups

Postby Gregory Martin » May 1st, 2019, 11:01 am

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.

Return to “Other”