Go down
avatar
Posts : 6
Points : 10
Join date : 2018-01-26
View user profile

Conditional Functions? IF function for an equation based on value of custom measurement Empty Conditional Functions? IF function for an equation based on value of custom measurement

on Fri Jan 26, 2018 11:10 pm
I'm making a pattern wherein a variable is only invoked IF another variable is a certain value.

I'm making a soft basket pattern.

Variables is:
@number_of_rows = number of rows of cotton strips
@length_waste = additional length added to account for waste/folding of wicker
@number_of_columns= number of columns of decoration

I want to make the equation:

IF @number_of_rows>@number_of_columns
THEN add 2 cm.

I am not sure how to accomplish this in functions for measurement. Any help with conditional functions?
dismine
Admin
Posts : 262
Points : 310
Join date : 2017-10-12
View user profilehttp://valentinaproject.forumotion.com

Conditional Functions? IF function for an equation based on value of custom measurement Empty Re: Conditional Functions? IF function for an equation based on value of custom measurement

on Sun Jan 28, 2018 10:49 am
Hi,

frippingtrippingblipping wrote:I am not sure how to accomplish this in functions for measurement. Any help with conditional functions?

We support ternary operator in form condition ? if true : if not true. For example:

@number_of_rows > 40 ? 5 : 30.

Since next test build you will have even more flexibility. Warning. This feature is not compatible with previous versions. In next test version you can use subexpressions. For example:

#a = @number_of_rows > 40 ? 5 : 30;
#b = #a > 50 ? 52 : 334;
#c = #b * 2

Where #a, #b, #c are local variables. Valentina will forget about values after formula evaluation.
avatar
Posts : 6
Points : 10
Join date : 2018-01-26
View user profile

Conditional Functions? IF function for an equation based on value of custom measurement Empty Re: Conditional Functions? IF function for an equation based on value of custom measurement

on Sun Jan 28, 2018 10:37 pm
I am very excited about this! I will be following to be the sure that I get the next version!
Sponsored content

Conditional Functions? IF function for an equation based on value of custom measurement Empty Re: Conditional Functions? IF function for an equation based on value of custom measurement

Back to top
Permissions in this forum:
You cannot reply to topics in this forum