1 Pages (4 items)
combining functions & statements - if/then + combobox - Messages
#1 Posted: 10/20/2016 10:52:04 PM
hi all-
i am wondering about building more logic into my if/then statements. I can not figure it out so far, I am not sure if its even possible... hoping to get some help or hints.
1.Can an if/then return a string AND calculation result. I have not be able to concatenate this in any way.
I have a if/then to check a value =< limit. If the limit is not exceeded, then the if_true is "Check OK". However, if the if_false should return "Limit Exceeded" and the actual calculated value.
Is this possible? What am I missing?
2. Can I have a combobox as part of an if_then function? If one condition is met, use one combobox, otherwise use a second.
Best regard
Dennis
i am wondering about building more logic into my if/then statements. I can not figure it out so far, I am not sure if its even possible... hoping to get some help or hints.
1.Can an if/then return a string AND calculation result. I have not be able to concatenate this in any way.
I have a if/then to check a value =< limit. If the limit is not exceeded, then the if_true is "Check OK". However, if the if_false should return "Limit Exceeded" and the actual calculated value.
Is this possible? What am I missing?
2. Can I have a combobox as part of an if_then function? If one condition is met, use one combobox, otherwise use a second.
Best regard
Dennis
Join the SMath Studio Users Discord Channel: https://discord.gg/PayZpJW
#2 Posted: 10/21/2016 2:08:13 AM
WroteWhat am I missing?
You are missing some typical work sheet examples !
#3 Posted: 10/21/2016 11:12:54 AM
Hi Dennis,
What about:If you use Custom Functions plugin you can use even:
Yes you can have it
![2016-10-21 16_11_06-SMath Studio - [WR - test new graphic.sm_].png](/en-US/file/WNDgX6/2016-10-21-16_11_06-SMath-Studio---_WR---test-new-graphic_sm___png)
Wrote1.Can an if/then return a string AND calculation result. I have not be able to concatenate this in any way.
What about:
concat("result is ",num2str(value))
concat("result is ",var2str(value))
Wrote2. Can I have a combobox as part of an if_then function? If one condition is met, use one combobox, otherwise use a second.
Yes you can have it
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#4 Posted: 10/23/2016 2:35:29 PM
Davide-
Thanks for reminding me, when i tried to use concat, i forgot that it was for text strings only.
Here is an example of one application- I am checking historic building members, and if they are overstressed, I want to know by how much.
using num2str, I get a fraction as a result.
if I create a variable, then using var2srt(2) I can control the output format. I would prefer to not have to define the variable, but its workable.

so the conclusion i am getting is the error is in the argument, not the if/then function. here I am using the custom functions with max function

Thanks again
Dennis
Thanks for reminding me, when i tried to use concat, i forgot that it was for text strings only.
Here is an example of one application- I am checking historic building members, and if they are overstressed, I want to know by how much.
using num2str, I get a fraction as a result.
if I create a variable, then using var2srt(2) I can control the output format. I would prefer to not have to define the variable, but its workable.
so the conclusion i am getting is the error is in the argument, not the if/then function. here I am using the custom functions with max function
Thanks again
Dennis
Join the SMath Studio Users Discord Channel: https://discord.gg/PayZpJW
1 Pages (4 items)
-
New Posts
-
No New Posts