Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


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.

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

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,980
Germany

Was thanked: 1120 time(s) in 718 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://smath.com/wiki/SMath_with_Plugins.ashx
thanks 1 user thanked mkraska for this useful post.
on 21/10/2022(UTC)
Offline - Norm -  
#4 Posted : 07 October 2022 05:21:22(UTC)
- Norm -


Rank: Advanced Member

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

Was thanked: 9 time(s) in 7 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.