Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 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.
|
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 13/01/2012(UTC) Posts: 2,647 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, ...) 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 |
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
Thanks Davide, you are great Educator ! Take care ... Jean.
|
|
|
|
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.