if then else statement

if then else statement - Messages

#1 Posted: 3/24/2019 3:57:17 PM
jbv74

jbv74

0 likes in 3 posts.

Group: User

Hello

I'm new in Smath

I want to do "if δ>0 then k=a+b else k=c+d"

But impossible to include the equation k:=a+b in the "if statement"

When I type "equal" after "k", the "equal" sign is put on the fist line and answer "k-not defined"

I found an exemple on the forum but I'm not able to reproduce it by myself

My test file is attached

Thank you for your help

test if statement.sm (5 KiB) downloaded 42 time(s).
#2 Posted: 3/24/2019 4:47:44 PM
sergio

sergio

115 likes in 329 posts.

Group: User

you have to type ":" (colon) and not "=" (equal)

sergio
#3 Posted: 3/24/2019 6:34:24 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Wrote

Thank you for your help



if_else.PNG
#4 Posted: 3/30/2019 3:52:09 PM
jbv74

jbv74

0 likes in 3 posts.

Group: User

Thanks
  • New Posts New Posts
  • No New Posts No New Posts