- Posts: 9
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Syntax for if-statements: Is there a way to use a vector in if-statements
- DVP17lemon
- Topic Author
- Offline
- New Member
Less
More
5 years 10 months ago #169201
by DVP17lemon
Syntax for if-statements: Is there a way to use a vector in if-statements was created by DVP17lemon
Hello, I am using a conjoint experiment with placeholders, that should print a yes/no if they match a variable that was assigned to 256 random combinations.
Now a segment of the placeholder looks like this:
{if(RANDOM == 3 or RANDOM == 4 or RANDOM == 7 or RANDOM == 8 or RANDOM == 11 or RANDOM == 12 or RANDOM == 15 or RANDOM == 16 or RANDOM == 19 or RANDOM == 20 or RANDOM == 23 or RANDOM == 24 or RANDOM == 27 or RANDOM == 28 or RANDOM == 31 or RANDOM == 32 or RANDOM == 35 or RANDOM == 36 or RANDOM == 39 or RANDOM == 40 or RANDOM == 43 or RANDOM == 44, 'Yes', 'No')}
Is there a way to use a vector like this:
if(RANDOM == (3,4,7,, 'Yes', 'No') ?
Or a different operator like "in"?
Now a segment of the placeholder looks like this:
{if(RANDOM == 3 or RANDOM == 4 or RANDOM == 7 or RANDOM == 8 or RANDOM == 11 or RANDOM == 12 or RANDOM == 15 or RANDOM == 16 or RANDOM == 19 or RANDOM == 20 or RANDOM == 23 or RANDOM == 24 or RANDOM == 27 or RANDOM == 28 or RANDOM == 31 or RANDOM == 32 or RANDOM == 35 or RANDOM == 36 or RANDOM == 39 or RANDOM == 40 or RANDOM == 43 or RANDOM == 44, 'Yes', 'No')}
Is there a way to use a vector like this:
if(RANDOM == (3,4,7,, 'Yes', 'No') ?
Or a different operator like "in"?
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10108
- Thank you received: 3593
5 years 10 months ago #169226
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Syntax for if-statements: Is there a way to use a vector in if-statements
No, that is not available in Expression Manager.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- orvil
- Offline
- Premium Member
Less
More
- Posts: 111
- Thank you received: 20
5 years 10 months ago #169232
by orvil
Best regards/Beste Grüße,
O. Villani
Replied by orvil on topic Syntax for if-statements: Is there a way to use a vector in if-statements
Just another problem where an extendable EM could help!
Solved a similar problem by doing so - but have to maintain and re-edit em_core_helper.php after every update
Solved a similar problem by doing so - but have to maintain and re-edit em_core_helper.php after every update
Best regards/Beste Grüße,
O. Villani
The topic has been locked.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11655
- Thank you received: 2740
5 years 10 months ago #169241
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic Syntax for if-statements: Is there a way to use a vector in if-statements
Tried to push it to the core?
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
The topic has been locked.