combining functions & statements

combining functions & statements - if/then + combobox - Сообщения

#1 Опубликовано: 20.10.2016 22:52:04
Dionysios J. Pantazis

Dionysios J. Pantazis

16 сообщений из 179 понравились пользователям.

Группа: User

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
Join the SMath Studio Users Discord Channel: https://discord.gg/PayZpJW
#2 Опубликовано: 21.10.2016 02:08:13
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

What am I missing?



You are missing some typical work sheet examples !

#3 Опубликовано: 21.10.2016 11:12:54
Davide Carpi

Davide Carpi

1416 сообщений из 2873 понравились пользователям.

Группа: Moderator

Hi Dennis,

Wrote

1.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))
If you use Custom Functions plugin you can use even:
concat("result is ",var2str(value))

Wrote

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.


Yes you can have it

2016-10-21 16_11_06-SMath Studio - [WR - test new graphic.sm_].png
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#4 Опубликовано: 23.10.2016 14:35:29
Dionysios J. Pantazis

Dionysios J. Pantazis

16 сообщений из 179 понравились пользователям.

Группа: User

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.

if-then.PNG

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

weld-conn1.PNG

Thanks again
Dennis
Join the SMath Studio Users Discord Channel: https://discord.gg/PayZpJW
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений