"on error"

"on error" - "on error" - Сообщения

#1 Опубликовано: 27.01.2022 20:37:35
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

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.
#2 Опубликовано: 28.01.2022 09:53:00
Davide Carpi

Davide Carpi

1416 сообщений из 2873 понравились пользователям.

Группа: Moderator

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
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#3 Опубликовано: 28.01.2022 12:11:21
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Thanks Davide, you are great Educator !
Take care ... Jean.
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений