Page 1 of 1

reenter

Posted: December 31st, 2020, 8:36 am
by etuser
Dear Cspro Team,

I am using Cspro 7.5 menu program and I have a variable (XX) which have two types of value sets xx_vs1 and xx_vs2 , From another variable (YY) return to this variable with a logic and "Move to" or "reenter" to variable XX , i want to display item labels xx_v2 , is it possible?

Thanks,

Re: reenter

Posted: December 31st, 2020, 5:45 pm
by Gregory Martin
I don't think I understand the question. You can use the setvalueset function to set a value set for either XX or YY, even if the value set doesn't "belong" to that item:
setvalueset(XX, XX_VS2); // fine
setvalueset(YY, XX_VS2); // also fine

Re: reenter

Posted: January 1st, 2021, 1:51 am
by etuser
Thank you for your response, to make it more clear, i have a value set to Household_interview variable namely Household_interview_Vs1 and Household_interview_Vs2.
On the form Household interview is at the top and "Team Number" is found bellow household interview variable .

Proc Household_interview
.
.
.
Proc Team_number

If team_number in 05 then
Move to Household_interview or reenter to Household_interview
//Here when we move to Household Interview , the value set to be displayed
// needs to be Household_interview_Vs2.
Elseif team_number in 07 then
Move to Household_interview or reenter to Household_interview
//Here when we move to Household Interview , the value set to be displayed
// needs to be Household_interview_Vs2.
Endif;

Re: reenter

Posted: January 1st, 2021, 2:40 pm
by Gregory Martin
If TEAM_NUMBER is located after HOUSEHOLD_INTERVIEW, then you'll have to use visualvalue to get the value:
PROC HOUSEHOLD_INTERVIEW

onfocus

    if visualvalue
(TEAM_NUMBER) = 5 then
        setvalueset
({...})
   
else
        // ...
   
endif;

Re: reenter

Posted: January 4th, 2021, 4:59 am
by etuser
Many thanks, it is working now.