Dear cspro team,
This is my questions
Q1: Which subject do you study? (Multiple question)
A=1
B=2
C=3
D=4
I designed var in cspro as below
Q1.a
Q1.b
Q1.c
Q1.d
I want data entry as below
Q1.a=1
Q1.b=blank
Q1.c=3
Q1.d=blank
Could you please advice me, how to write code?
Regards
Komin
Multiple questions in data entry on desktop
Re: Multiple questions in data entry on desktop
You need to explain this more. Is Q1 a single variable in your dictionary with value set a, b, c, d or do you have four separate questions q1a, q1b, q1c, q1d? What is the desired behavior when you say you want "Q1. a = 3"? Is this what the user is entering or are you setting the value from logic?
Re: Multiple questions in data entry on desktop
Dear Josh,
Yes I have four var separated q1a, q1b, q1c, q1d.
But in q1a, I want input value 1 or blank only. How can I write the logic?
Regards
Komin
Yes I have four var separated q1a, q1b, q1c, q1d.
But in q1a, I want input value 1 or blank only. How can I write the logic?
Regards
Komin
Re: Multiple questions in data entry on desktop
You could make a value set that only contains 1 and notappl (in CSPro notappl is how you refer to blank). CSPro will not let you enter values outside the value set.
You could also use logic to verify that only blank or 1 is entered:
You could also use logic to verify that only blank or 1 is entered:
postproc
if not $ in 1, notappl then
errmsg("Must be 1 or blank");
endif;
Note that in either case to allow entry of blank you will need to use the setproperty function to set "CanEnterNotAppl" to "NoConfirm" for your field as CSPro generally does not allow entry of blank. See help on setproperty for more details. Normally in CSPro you use blank to indicate a question has been skipped and you use a different value for non-response (often code 9).if not $ in 1, notappl then
errmsg("Must be 1 or blank");
endif;
Re: Multiple questions in data entry on desktop
Dear Josh,
Could please tell me the function CanEnterNotAppl to noconfirm in field?
Regard
Komin
Could please tell me the function CanEnterNotAppl to noconfirm in field?
Regard
Komin
Re: Multiple questions in data entry on desktop
See the help for the function setproperty (http://www.csprousers.org/help/CSPro/se ... ction.html). You can call setproperty anywhere in your logic BEFORE the field that you want to allow blanks for including the preproc of the field itself.
Re: Multiple questions in data entry on desktop
Dear Josh,
Could you please give me a real script?
Regards
Komin
Could you please give me a real script?
Regards
Komin
-
- Posts: 1812
- Joined: December 5th, 2011, 11:27 pm
- Location: Washington, DC
Re: Multiple questions in data entry on desktop
This is an example of how to set the property in logic:
PROC FIELD_NAME
preproc
setproperty(FIELD_NAME,"CanEnterOutOfRange","NoConfirm");
postproc
if not FIELD_NAME in 1,notappl then
errmsg("Must be 1 or blank");
reenter;
endif;
You can also assign blank as Missing as a value to your value set and then you do not have to set this in logic.preproc
setproperty(FIELD_NAME,"CanEnterOutOfRange","NoConfirm");
postproc
if not FIELD_NAME in 1,notappl then
errmsg("Must be 1 or blank");
reenter;
endif;
Re: Multiple questions in data entry on desktop
Dear CSPro Users,
I am using CSPro 7.0.2. Could you please explain why I cannot use the "setproperty" function. The system does not recognize it as a built-in function.
I am using CSPro 7.0.2. Could you please explain why I cannot use the "setproperty" function. The system does not recognize it as a built-in function.
Re: Multiple questions in data entry on desktop
Setproperty function is new command introduced and works with CSpro 7.1 which is yet to be leased soon. If you are comfortable with the 7.1 beta then you can use it for your setup.