Help for logic code

Discussions about CSEntry
Forum rules
New release: CSPro 8.0
Post Reply
PEHAN Boré Hermann
Posts: 3
Joined: July 23rd, 2016, 2:22 pm

Help for logic code

Post by PEHAN Boré Hermann »

Hello Sir,
I needed an help.
I have a table like the file's attached.
I want to put in column "Expensive total" the somme of "expensive 1", "expensive 2", "expensive 3", ..., "expensive 8".
Also, i would like that if medecine (i)="", to skip to "Type of patient".
Is there somebody to help me to get this logic code?

Thank everybody for your eventual helps.
Attachments
Essay.7z
(4.73 KiB) Downloaded 280 times
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Help for logic code

Post by josh »

To compute a sum you can just add the variables together:

EXPENSIVE_TOTAL = EXPENSIVE_1 + EXPENSIVE_2 + EXPENSIVE_3 ....

You can do this in the preproc of EXPENSIVE_TOTAL

For the skip you just need to use the skip command and and if then else expression. The only tricky part is that you need to use strip to remove the padding (the extra spaces) since alpha values in CSPro are fixed length.
if strip(MEDECINE_1) = "" then
    
skip to TYPE_OF_PATIENT;
endif;
Rodriguez Ajabu
Posts: 1
Joined: February 20th, 2018, 8:49 am

Re: Help for logic code

Post by Rodriguez Ajabu »

Hello,

I'm creating my application but I'm hooked on a display instruction.
for Q1 the answer is either 1 = yes or 2 = no, Q2 is 1 = yes or 2 = no, Q3 is 1 = yes and 2 = no
so, I would like that at the level of Q4 only the labels that received 1 could appear.
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Help for logic code

Post by josh »

Next time please create a new post instead of replying to an unrelated topic.

What you want to do is commonly referred to as "dynamic value set" in CSPro. The function to use is called setvalueset(). You can look in the help for info on that function. You can also search this forum for "setvalueset" and "dynamic value set" to see related questions.
Post Reply