There's no "is different" in the IfThenElse primitive?
Archive · 20129 old posts
From the original SynthMaker forum (2004–2014), with its members’ names and dates.
distante ·
I have a string value that can have this values : 1,0,not.
So I want to do something like this
IF VALUE (is different) not
then let pass VALUE
Else
Don't let pass the value.
I know from other languages that I can use "<>" or "!=" but in the SM manual don't mention anything about a "is different" condition.
The comparison operation,
“=”,“<=”,”<”,”>' or ”>=”
Is possible to do what I want in the IfThenElse primitive?
CoreStyler ·
not.
But you can do like:
IF VALUE1 (is less/is greater) VALUE2
then let pass VALUE1
Else
Don't let pass the value.
Another thing you can do, is without if then else.
This example do:
if a < 0 pass b
if b > 0 pass b
To pass only one input, you can do a bool logic that is:
if input < X = bool
if input > X = bool
if bool true pass X if not then Not pass
distante ·
mmm I think I can use if is less or equal to 1 let the value pass, if not use "not"
for this case it will be ok, But what happen if I need to do something similar but with strings?
CoreStyler ·
There are some workarounds. for example, if you want list of thing that are true you can do that:
So if a input string is not present in the list, the string find will output -1.
So, if -1 appears you will get true. When bool is true, string is not present.
So you can figure to pass a string when present and not when not present.
distante ·
Thanks! took me a while to understand how make it work (didn't get that 0 its the first position) But now I have it working
Thank you a lot!
Cheer!
cyto ·
You may also want to look into creating a custom parser. Oddson put up a very nice introduction here. You will need to use some "R&D" components, but from what I understand, they are quite stable. To show the R&D components, go to options>advanced>show R&D. There are many people here (not me) that have created some very wonderful things with these parsers.
-cyto
distante ·
I already achieved what I was trying to do, BUT, I will look what you told, Maybe I can do more with less 😉
oddson ·
There doesn't appear to be a not equal operator in IfThenElse (although there is in code, it's "!=").
I'm not sure there could be on in the IfThenElse primitive.
How would it parse multiple conditions?
If you feed the conditions input three different numbers then all numbers fed to the 'if' input will be not equal to at least two of them... so which result out of the 'then' input should it output?
distante ·
I see this in this way
I have this string box
0.1
0.5
1
And I need to know if the value 0.7 (that for some reason needs a different output) I ask
If Value != 0.7 then flow the values
Else
Use Other data.
Something like that 😕
Wrote something here? To have a post removed or your name hidden, write to [email protected].