Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Offline golias  
#1 Posted : 24 September 2022 21:02:57(UTC)
golias

Rank: Newbie

Groups: Registered
Joined: 24/09/2022(UTC)
Posts: 2

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.
Offline golias  
#2 Posted : 24 September 2022 21:23:49(UTC)
golias

Rank: Newbie

Groups: Registered
Joined: 24/09/2022(UTC)
Posts: 2

OK, this happens in last version. I checked in build 8151 it does not occur, seems like a bug.
Offline mkraska  
#3 Posted : 25 September 2022 00:32:34(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,757
Germany

Was thanked: 967 time(s) in 615 post(s)
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/wi...th%20with%20Plugins.ashx
thanks 1 user thanked mkraska for this useful post.
on 21/10/2022(UTC)
Offline nasch  
#4 Posted : 07 October 2022 05:21:22(UTC)
nasch


Rank: Advanced Member

Groups: Registered
Joined: 29/11/2017(UTC)
Posts: 63
United States
Location: Midwest

Was thanked: 4 time(s) in 4 post(s)
Ah-h! Good to know. I was scratching my head on this one!

Thank you!

Norm
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.