text in if statements

text in if statements - 消息

#1 已发布: 2019/5/1 17:40:54
The Cross

The Cross

0个赞,共73个帖子。

组: User

Can text be included in an if statement? For example:
If "Thin-walled pipe anchored throughout" then P=1-v.

I have various conditions that different formulas would be used depending on the conditions, see below.restraints.png
#2 已发布: 2019/5/1 18:24:24
Alvaro

Alvaro

1,139个赞,共1,805个帖子。

组: User

Hi. You have some options for do that. Here are two:
Clipboard01.gif
Best regards.
Alvaro.
#3 已发布: 2019/5/1 22:04:46
Jean Giraud

Jean Giraud

983个赞,共6,866个帖子。

组: User

Wrote

You have some options for doing that.


Easy to complete the conditions, thus the project.
Cheers Alvaro ... Jean

str.PNG

#4 已发布: 2019/5/2 17:41:07
The Cross

The Cross

0个赞,共73个帖子。

组: User

I don't understand how to input the data into the statement. If I press the space key, the input ends, and I cannot input anything.
#5 已发布: 2019/5/2 17:47:44
Jean Giraud

Jean Giraud

983个赞,共6,866个帖子。

组: User

Wrote

I don't understand how to input the data into the statement.
If I press the space key, the input ends, and I cannot input anything.


There is no space key to press. Construct the snippet, done.
#6 已发布: 2019/5/2 18:04:03
The Cross

The Cross

0个赞,共73个帖子。

组: User

Sorry, I have never constructed a snippet before. How do I do that?
#7 已发布: 2019/5/2 19:05:13
Jean Giraud

Jean Giraud

983个赞,共6,866个帖子。

组: User

Wrote

Sorry, I have never constructed a snippet before. How do I do that?


Construct the math regions as per the image that we call snippet.
#8 已发布: 2019/5/3 10:15:42
The Cross

The Cross

0个赞,共73个帖子。

组: User

I tried to construct it. My question is how to do that. I try and the below is what happens:if statement.png
#9 已发布: 2019/5/3 13:09:07
Jean Giraud

Jean Giraud

983个赞,共6,866个帖子。

组: User

g(str,x):=then from menu f(x), then cases, then fill-in
#10 已发布: 2019/5/3 14:11:45
fedeghi

fedeghi

25个赞,共112个帖子。

组: User

The cases() function is included into the "custom functions" plugin, so you should also be sure to have it installed.

Cattura.PNG
1位用户喜欢此帖子
frapuano 2019/5/3 14:38:00
#11 已发布: 2019/5/3 16:16:46
The Cross

The Cross

0个赞,共73个帖子。

组: User

Wrote

The cases() function is included into the "custom functions" plugin, so you should also be sure to have it installed.

Cattura.PNG



Thank you. I had the "custom functions" plugin installed, but the use of it is not in any of the manuals, at least not that I could find. I had no idea I had to type the word "cases" to get to the input.
#12 已发布: 2019/5/3 16:19:43
The Cross

The Cross

0个赞,共73个帖子。

组: User

Wrote

g(str,x):=then from menu f(x), then cases, then fill-in



Thank you. I understand now.
#13 已发布: 2019/5/3 17:37:20
Jean Giraud

Jean Giraud

983个赞,共6,866个帖子。

组: User

Wrote

I had no idea I had to type the word "cases"


only click the function 'cases' from the f(x) menu.
In the right most place holder of the first 'if'
place the cursor type coma, coma [,,]
that gives another line of conditions ... and so on.
#14 已发布: 2019/5/3 17:48:24
The Cross

The Cross

0个赞,共73个帖子。

组: User

Wrote

Wrote

I had no idea I had to type the word "cases"


only click the function 'cases' from the f(x) menu.
In the right most place holder of the first 'if'
place the cursor type coma, coma [,,]
that gives another line of conditions ... and so on.



Thank you. I was trying to figure out how to do that.
#15 已发布: 2019/5/7 13:15:44
The Cross

The Cross

0个赞,共73个帖子。

组: User

Wrote

Wrote

You have some options for doing that.


Easy to complete the conditions, thus the project.
Cheers Alvaro ... Jean

str.PNG



I use the cases function to type everything in, but when I go back to the first line that says "x if str", as soon as I type "x if str =, as soon as I type the = sign, I get "x not defined". I am trying to understand, but not getting it yet. I had it almost working, but then this glitch appeared.
#16 已发布: 2019/5/7 13:39:45
The Cross

The Cross

0个赞,共73个帖子。

组: User

Wrote

Wrote

Wrote

You have some options for doing that.


Easy to complete the conditions, thus the project.
Cheers Alvaro ... Jean

str.PNG



I use the cases function to type everything in, but when I go back to the first line that says "x if str", as soon as I type "x if str =, as soon as I type the = sign, I get "x not defined". I am trying to understand, but not getting it yet. I had it almost working, but then this glitch appeared.



I figured out how I did it before. I cannot type the = in the above, but it works with a :=. But it does not really work, because if I say str:="b" and x:=7, the answer is 21.99 instead of 14, but it does allow me to type it. I am confused.
#17 已发布: 2019/5/7 14:54:10
Jean Giraud

Jean Giraud

983个赞,共6,866个帖子。

组: User

Wrote

I figured out how I did it before. I cannot type the = in the above, but it works with a :=. But it does not really work, because if I say str:="b" and x:=7, the answer is 21.99 instead of 14, but it does allow me to type it. I am confused.



Equality.PNG

#18 已发布: 2019/5/7 15:18:13
Davide Carpi

Davide Carpi

1,443个赞,共2,936个帖子。

组: Moderator

Wrote

Wrote

Wrote

Wrote

You have some options for doing that.


Easy to complete the conditions, thus the project.
Cheers Alvaro ... Jean

str.PNG



I use the cases function to type everything in, but when I go back to the first line that says "x if str", as soon as I type "x if str =, as soon as I type the = sign, I get "x not defined". I am trying to understand, but not getting it yet. I had it almost working, but then this glitch appeared.



I figured out how I did it before. I cannot type the = in the above, but it works with a :=. But it does not really work, because if I say str:="b" and x:=7, the answer is 21.99 instead of 14, but it does allow me to type it. I am confused.



Please post the worksheet or a screenshot. In the second column of cases you have to use boolean equals, not the assignment operator.

You can find the boolean operators in one of the palettes on the right of your screen, hovering the mouse hover the symbols you should see the keyboard shortcut.
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#19 已发布: 2019/5/7 15:26:07
The Cross

The Cross

0个赞,共73个帖子。

组: User

Wrote

Wrote

I figured out how I did it before. I cannot type the = in the above, but it works with a :=. But it does not really work, because if I say str:="b" and x:=7, the answer is 21.99 instead of 14, but it does allow me to type it. I am confused.



Equality.PNG



thank you. I can't use the "Thank" button because every time I do, it says "error occurred"
#20 已发布: 2019/5/7 15:31:51
The Cross

The Cross

0个赞,共73个帖子。

组: User

Wrote

Wrote

I had no idea I had to type the word "cases"


only click the function 'cases' from the f(x) menu.
In the right most place holder of the first 'if'
place the cursor type coma, coma [,,]
that gives another line of conditions ... and so on.



How do I remove a line. I tried backspacing, and it did not work.
  • 有新帖
  • 无新帖