problem with if

problem with if - programming if does not show else - Messages

#1 Posted: 9/24/2022 3:02:57 PM
Carlos Couto

Carlos Couto

0 likes in 2 posts.

Group: User

Hi,
Maybe this is a very dumb question but how can I add a "if else" structure?
When I click the "if" in the programming toolbar no "else" is added.
#2 Posted: 9/24/2022 3:23:49 PM
Carlos Couto

Carlos Couto

0 likes in 2 posts.

Group: User

OK, this happens in last version. I checked in build 8151 it does not occur, seems like a bug.
#3 Posted: 9/24/2022 6:32:34 PM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

The if function now has a variable number of operands. The side panel and the dynamic assistant insert the binary form by default. Just type one or more argument separators immediately after insterting the function and see what happens. Likewise you can delete operators by typing backspace.

The binary form is a compact notation if you don't need the else clause.

However, I prefer the cases() function from the custom functions plugin, because it is more compact.

ifcases.png
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 users liked this post
Oscar Campo 10/21/2022 12:29:00 PM
#4 Posted: 10/6/2022 11:21:22 PM
Norm Schutzkus

Norm Schutzkus

9 likes in 90 posts.

Group: User

Ah-h! Good to know. I was scratching my head on this one!

Thank you!

Norm
  • New Posts New Posts
  • No New Posts No New Posts