MG2024
November 21, 2024, 10:10pm
1
@Douglas
Hallo Douglas,
may it is possible to have more as 1 condition, this would avoid confusing formulas.
e.g. #S_VH==2?0:#b_Bf_2>0?5:0 (if Style = 2 and 2nd pleat >0 than 5)
option #S_VH==2;#b_Bf_2>0?5:0 ( condition 1; condition 2; …?) both conditions have to be true
Hope this will not take to many effort.
(Btw as I type a condition and the condition is false than is it not possible to use 0,
e.g. A=100 | A==101?0:5 not possible
e.g. A=100 | A>100?0:5 is possible)
1 Like
Grace
November 22, 2024, 6:26am
2
Hello, @MG2024
The functions is Seamly2D are powered by muParser. You will find a list of the functions here and how to use them.
According to the muParser, the ampersand (&) is the character to use for the AND. Here I’ve tested the AND condition:
The formula is: (#size>2)&&(#Fit>0)?10:5
I hope that this helps you.
Douglas
November 22, 2024, 7:39am
3
@MG2024
Just to add to that… the logical “operators” follow the C++ syntax, where Equal uses ==, AND uses &&, OR uses ||, etc. Common mistake is forgetting and using just one =, | or & and it changes the operation. I’d be lying if I said I’ve never done that in the app code… fortunately the compiler will flag such an error when building the apps.
2 Likes
MG2024
November 23, 2024, 8:36am
4
Perfect, thanks it works.
I found an overview online.
This function is not descripted on https://wiki.seamly.io/ .
Maybe just adding a link to the overview under functions.