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 Jean Giraud  
#1 Posted : 28 January 2022 02:37:35(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
If the object does not exist in the scan ... I understand.
If > 10^307 ... if < 10^-307 ... I understand.
What else creates "on error" ?
MCD 11 and Smath often disagree.
In some instance, Smath "on error" must be coded otherwise.
Comments appreciated .... Cheers, Jean.

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

Offline Davide Carpi  
#2 Posted : 28 January 2022 15:53:00(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,647
Man
Italy
Location: Italy

Was thanked: 1329 time(s) in 875 post(s)
Hello Jean,

try/onerror is just a way to manage errors.

They happens because a lot of reasons (values too high, file I/O, operation on strings, mixed types on data sources, mixed units, bad user input, etc...) and you might expect some specific errors or some "possible, currently undefined" errors.

If you might want to handle them in a custom way other than the low-level error message, that is the function to do it.

For example you can use it to override results with some default value, or give some hint to change something; the use depends on the context, what are the input variables and what you expect to happen in case of a predictable or "unpredictable" error.

IDK if can be improved in some way, but is a common and very simple function in most programming languages (try-catch in C-style languages, try-except in Phyton, ...)

2022-01-28 13_39_04-SMath Solver - [Worksheet1_].png

Edited by user 28 January 2022 16:03:35(UTC)  | Reason: Not specified

If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
Offline Jean Giraud  
#3 Posted : 28 January 2022 18:11:21(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Thanks Davide, you are great Educator !
Take care ... Jean.
Users browsing this topic
Guest
Similar Topics
ODE "on error" (Samples)
by Jean Giraud 05/12/2020 20:54:52(UTC)
"on error" test image rotate (Feature Requests)
by Jean Giraud 16/04/2016 20:42:32(UTC)
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.